-
Hello all, I tried to convert some of my HIF images into JPGs and found some of the images were throwing the below error:
The root cause was that I had applied rotation to my images and on the IOS system, the rotation was applied to the EXIF rather than the image data itself. I made use of from PIL import Image, ImageOps
from pillow_heif import register_heif_opener
register_heif_opener()
def save_jpg(path, quality=100, subsampling=0):
temp, _ = path.split(".")
temp += ".jpg"
im = Image.open(path)
im = ImageOps.exif_transpose(im)
print(f"Saving to {temp}")
im.save(temp, quality=quality, subsampling=subsampling)
# for filename in sys.argv[1:]:
# save_jpg(filename)
name = "DSC03260.HIF"
save_jpg(name) |
Beta Was this translation helpful? Give feedback.
Answered by
bigcat88
Mar 17, 2023
Replies: 1 comment 2 replies
-
@Soooda post a link to an image, for me currently it looks like a bug. Issue #86 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Soooda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Soooda post a link to an image, for me currently it looks like a bug. Issue #86