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 avif to the compatible Image Formats #1228

Closed
wants to merge 1 commit into from

Conversation

yoshnopa
Copy link
Contributor

Avif is a new open image format which is very likely to be the next big format. It is supported by Chrome (and Chromium-derivates) as well as Firefox, although there is a config variable you have to set (should be gone any time now, it was announced to be standard at the end of February).

@ghost
Copy link

ghost commented Mar 24, 2021

Unfortunately adding avif to the supported extension list isn't enough, we also need to add an image decoder for avif, and as far as I can tell there isn't one yet apart from go-avif which is a wrapper around libaom which is a C-library.

@yoshnopa
Copy link
Contributor Author

What do we need the decoder for? I tested it and everything worked fine.

@yoshnopa
Copy link
Contributor Author

To elaborate on that, when searching for "gif" in the repo, there is only one occurance in the Code which is only triggered on creating a thumbnail for a scene (which in turn is done by taking a shot from the video). There is no occurance associated with the actual image object (from the image tab) beside in the array of allowed filetypes, the line that was modified in this request.

@bnkai
Copy link
Collaborator

bnkai commented Mar 24, 2021

You missed the image.SetFileDetails part probably.
Having a decoder is needed for the thumbnail creation as you mentioned and to get the dimensions width/height and calculate the resolution.
I dont think we should add the extension to the default ones till we have a working (pure-go) decoder.
Is there a specific reason it had to be in the default anyway? Any user can add whatever extension they want if they can live with the limited usability.

EDIT: Didnt make that clear before. Gif support is added when we import the image go package. It has png, jpg, gif (encode,decode) support so it wouldnt show up in the search you made for gif (an image.decode can handle all the mentioned formats).

@ghost
Copy link

ghost commented Mar 24, 2021

I'm not overly realistic about there ever being a pure go avif decoder since it seems a whole lot more complex than most image formats. A more realistic approach might be using ffmpeg, but even that doesn't support avif yet.

At some point I'd like to figure out a way to dynamically link libjpeg when available, and if we get there we might be able to add libaom as well, but I don't know how easy it is.

@bnkai
Copy link
Collaborator

bnkai commented Mar 24, 2021

Sadly avif/heiff are already requested for a couple of years in the ffmpeg trac. I wouldnt expect them soon.

@yoshnopa
Copy link
Contributor Author

yoshnopa commented Mar 25, 2021

Thank you for your patience, you're right I didn't find the SetFileDetals.
Also, I wasn't aware that you can set the allowed file endings in the settings, maybe I should check that before trying to compile a new version 😅
Anyway, thank you for your patience, I agree that this might be far to soon and would suggest compatibility where there is none.

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

Successfully merging this pull request may close these issues.

None yet

2 participants