Skip to content

feat: Add feature version for avif_codecs #28

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

Closed
wants to merge 1 commit into from

Conversation

fdintino
Copy link
Owner

@fdintino fdintino commented Mar 19, 2025

This exposes the value from avifCodecVersions(), which would allow users of the library to confirm the versions of codecs before trying to use codec-specific options (such as tune=iq or avif=1 in aom and SVT-AV1, respectively).

cc: @radarhere

This exposes the value from avifCodecVersions, which would allow users
of the library to confirm the versions of codecs before trying to use
codec-specific options (such as tune=iq or avif=1 in aom and SVT-AV1,
respectively).
@radarhere
Copy link
Collaborator

radarhere commented Mar 20, 2025

I think it kind of clutters features.py, and I don't think

dav1d [dec]:1.5.1, aom [enc/dec]:3.12.0, rav1e [enc]:0.7.1 (), svt [enc]:v3.0.0

is very friendly.

If I suggest AvifImagePlugin.get_codec_version(codec_name) instead, that returns the version string (or None if the codec isn't available), how does that sound?

@fdintino
Copy link
Owner Author

I like that, and I don't disagree with you about the ugliness of the interface. Unfortunately, libavif doesn't return anything beyond this semi-structured string. In its own code (e.g. avifenc) they will string-parse the versions from this string. If I make certain assumptions about the format of avifCodecVersions I could use a regular expression to build a dictionary. Or I could ask the maintainers of libavif if they could provide a better interface. Thoughts?

@fdintino
Copy link
Owner Author

ping @radarhere in case you're not getting notifications for this PR.

@radarhere
Copy link
Collaborator

It sounds like you have an argument that if people want to check for the availability of codec-specific options, then there should be an easier way to check that availability in C. If you think that's a worthwhile endeavour separate to Pillow, then sure, raise it with them.

However, I don't personally think the current form is a blocker for inclusion in Pillow. I've created #29

@fdintino fdintino closed this Mar 21, 2025
@fdintino fdintino deleted the libavif-plugin-codec-versions branch March 21, 2025 17:35
radarhere added a commit that referenced this pull request Mar 31, 2025
Skip failing WMF records on 32-bit Windows
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.

2 participants