Files
Logo-Imagenes/heic_to_jpg.py
T
2026-07-20 14:52:07 +02:00

12 lines
521 B
Python

import os, subprocess
directory = 'heic2'
for folder,subfolder,files in os.walk(directory):
for filename in files:
if filename.lower().endswith(".heic") or filename.lower().endswith(".HEIC"):
print('Converting %s' % os.path.join(folder, filename))
bashCommand = "heif-convert -q 100 \'./"+folder+"/"+filename+"\' \'./"+folder+"/"+filename.replace('.HEIC', '.jpg')+"\'"
print(bashCommand)
result = subprocess.run([bashCommand], shell=True)
continue