Refactor
This commit is contained in:
parent
30bd30e038
commit
71c8ea7bbd
41 changed files with 375 additions and 284 deletions
19
Shell Scripts/python/convert_heic.py
Normal file
19
Shell Scripts/python/convert_heic.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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()
|
||||
Loading…
Reference in a new issue