-
-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support HEIF image file #1042
Support HEIF image file #1042
Conversation
never mind about my previous deleted comment. as I see, CI needs wheels for PyPy3.8 - if I will know that this will have high chances to be merged, I can restore the publishing of PyPy3.8 wheels for the next release, if it is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome initiative, thanks @Pandede 🚀 This looks pretty good from the plugin implementation side. I think we'll only need one round of reviews before we can merge.
We should properly register the format so that pillow is automatically tried first for .heic
files. To do so we need to add a new FileExtension
in the relevant config file. This will also add the necessary documentation so that HEIC shows up in the list of supported formats :)
Beyond that, there is one change (making pillow_heif
option) that I would like to see before we merge.
done from my side, new release was published :) |
The tests are failed as the latest upgrade of Update: # Raise AttributeError
image = Image.open("example.png", mode="L")
# Should specify the mode by using `convert`
image = Image.open("example.png").convert("L") Here is the reference. |
Yes. There is another issue related to pillow's recent upgrade. I'll pin pillow for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side.
I will check why why the pypi CI no longer likes the av package and then we should be able to get a green CI :)
@@ -1855,6 +1855,9 @@ def reset(self): | |||
extension=".btf", | |||
priority=["tifffile"], | |||
), | |||
FileExtension( | |||
name="High Efficiency Image File Format", extension=".heic", priority=["pillow"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoudn't ".heif" and ".hif" (and potentially ".avif") be added as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Some cameras now output .HIF directly (I guess limitations of sdcard filesystem like old 8.3 filename format from DOS times!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.33.0 is still missing ".heif" and ".hif".
Also, libheif from 1.17 supports the JPEG 2000 codec inside the HEIF container w/ a ".hej2" extension, see https://www.itu.int/rec/T-REC-T.815/en
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a new issue about the multiple extensions of HEIF?
Resolves #1021.
The previous pull request #1040 is closed as the redundant commits.
And also, move
pillow-heif
to be a plugin rather than extra requirement ofPillow
(thanks for the advice of @bigcat88).