19 lines
No EOL
417 B
Python
19 lines
No EOL
417 B
Python
from PIL import Image
|
|
from pillow_heif import register_heif_opener
|
|
from pathlib import Path
|
|
from sys import argv
|
|
|
|
def main() -> None:
|
|
if len(argv) < 2:
|
|
return
|
|
|
|
path = Path(argv[1]).resolve()
|
|
if path.suffix.lower() != ".heic":
|
|
return
|
|
|
|
register_heif_opener()
|
|
im = Image.open(path)
|
|
im.save(path.with_suffix(".jpeg"), quality=100)
|
|
|
|
if __name__ == "__main__":
|
|
main() |