Skip to content
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

Add support for AVIF images #363

Open
lapo-luchini opened this issue Dec 30, 2022 · 3 comments
Open

Add support for AVIF images #363

lapo-luchini opened this issue Dec 30, 2022 · 3 comments

Comments

@lapo-luchini
Copy link
Contributor

We should add support for AVIF images (and maybe HEIF too? but I'll prioritize AVIF myself), such as this:

https://libre-software.net/image/avif-test/

I see two problems right now:

  1. the bookmarklet doesn't detect it
  2. if forced, the server fails on IntegrityError at /api/v2/pins/ NOT NULL constraint failed: django_images_image.height
@winkidney
Copy link
Member

Would you please upload some AVIF test file here?
I may test it on my own instance and then update the code(bookmarketlet and backend) if necessary.

@lapo-luchini
Copy link
Contributor Author

There are a few CC-BY-SA in this GitHub.

@Avatat
Copy link
Contributor

Avatat commented Mar 23, 2023

I found out that Pinry relies on ImageField model field used to upload images and get some metadata about them: https://github.com/pinry/pinry/blob/master/django_images/models.py#L47

On the other hand, ImageField relies on PIL/Pillow to validate uploaded image extension and probably more: https://github.com/django/django/blob/main/django/core/validators.py#L572

And it turns out that AVIF support is waiting for two years to be merged to Pillow: python-pillow/Pillow#5201
While there's no native AVIF support in Pillow, we'll be forced to use some plugins and load them somehow in Django code, which is too much for my knowledge ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants