0

Is there a way to handle .heic image files in Python 2.7? For example, converting it to a jpg. Ideally with metadata, but could be OK without.

PIL/Pillow doesn't handle it natively. Pyheif requires Python 3.6+. (And, no, converting all our code to Python 3 is not a realistic solution right now.)

CrazyChucky
  • 3,263
  • 4
  • 11
  • 25
user984003
  • 28,050
  • 64
  • 189
  • 285
  • 1
    Pyheif can save images as JPEG. Would you be amenable to running a Python 3 script that does that, in preparation for your main code? You could even make it a command line utility and run it with `subprocess` from your main code. – CrazyChucky Dec 24 '21 at 22:48
  • 1
    (Having simultaneous Python 2 and 3 installations is usually pretty doable, depending on your platform, and it could be a good first step toward eventually transitioning. Python 2 is almost two years out of being supported, after all.) – CrazyChucky Dec 24 '21 at 22:50
  • I am using Ubuntu with Pyenv so having multiple installations would be doable. Call one from the other. – user984003 Dec 26 '21 at 15:38

0 Answers0