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

display libavif version and codecs via phpinfo() #7526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andypost
Copy link
Contributor

I find it helpful for debug to see which libavif version is linked

@andypost
Copy link
Contributor Author

@morsssss probably it could be cleaned-up a bit but works for me

@cmb69
Copy link
Member

cmb69 commented Sep 28, 2021

If we do that, we should do it for the other libs (libjpeg etc.) as well. And wrt. avif, the available codecs would be of interest.

@andypost
Copy link
Contributor Author

Good idea, gonna work on it

@andypost andypost force-pushed the libavif-version branch 2 times, most recently from 18391b4 to a1f0b98 Compare September 29, 2021 00:16
@andypost
Copy link
Contributor Author

andypost commented Sep 29, 2021

I checked libjpeg-turbo and libwebp installed on Ubuntu 21.10 (beta) and I can't find API to get version

Probably each library needs to define versions via pkgconf

$ php --ri gd

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
GIF Read Support => enabled
GIF Create Support => enabled
PNG Support => enabled
libPNG Version => 1.6.37
WBMP Support => enabled
XBM Support => enabled
BMP Support => enabled
AVIF Support => enabled
AVIF Version => 0.8.4
AVIF Codecs => dav1d [dec]:0.7.1, libgav1 [dec]:0.16.1
TGA Read Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1

@andypost andypost changed the title display libavif version via phpinfo() display libavif version and codecs via phpinfo() Sep 29, 2021
@andypost
Copy link
Contributor Author

version string only available with bundled GD

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On further consideration, I don't think this is the right approach. Instead libgd could provide the version information, and then we could use their API. I suggest to file a feature request or submit a pull request there.

@andypost
Copy link
Contributor Author

andypost commented Oct 2, 2021

@cmb69 thank you! filed libgd/libgd#782

@mondrake
Copy link

mondrake commented Aug 15, 2022

I would be very +1 on getting this is in while a GD lib solution is found - it's rather simple and I cannot see a negative side effect - while the GD lib way will take much longer to get in PHP.

In Drupal we are trying to get AVIF support (https://www.drupal.org/project/drupal/issues/3202016), but there's currently no way to introspect AVIF support and report if anything is missing in the configuration - gdinfo() and the relative imageavif() functions are there, can be tested against, but still calling imageavif() without a coder leads to an error. That's a rather fragile status. With this we could check if codecs are missing and report to site admins.

@cmb69
Copy link
Member

cmb69 commented Aug 15, 2022

I would be very +1 on getting this is in while a GD lib solution is found - it's rather simple and I cannot see a negative side effect - while the GD lib way will take much longer to get in PHP.

Well, this patch is only for bundled libgd (and I don't think this is usually used, except on Windows), so a solution in libgd would be needed for other builds.

@andypost
Copy link
Contributor Author

Sounds like there's good progress in 8.4 85e5635

@andypost
Copy link
Contributor Author

one more bit is fixed 0079932

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

Successfully merging this pull request may close these issues.

4 participants