-
Notifications
You must be signed in to change notification settings - Fork 261
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
Looking for API to get "version info" of supported image formats #782
Comments
Good morning It could be easy to implement but I am not sure it makes sense for libgd to provide as all of them are compile time defined. f.e. pkg-config (or in php's case, configure) defines that list. We could define multiple struct with name, version, etc but that means every single scripting language would have to map it anyway, instead of using their own collection surrounded by the HAVE_* macros. Libraries and codecs have also completely different meta info. Then they have options, some have plugins (like AVIF) which may be dynamically loaded at runtime. etc. What we could do is one function specific for each codec. As each would have different information as well. Something like: gdVersion<Major|Minor|String|..> or gdSupport etc. But again, almost all of this are compile time settings from a libgd point of view. The codecs options are runtime and here I am on a new encoding/decoding APIs allowing to access all options of a codec without us having to map each single of them using a new function (SetOption( of Name/value). Happy to add anything that helps our users, if you have suggestions please let me know :) |
I still think that libgd should provide this info to clients, because the client usually just includes gd.h, and not the individual headers of the used libraries. And, at least if there are several clients who would use this info, the same/similar code would need to be written only once. |
ok, not sure which format, to be useful programmatically for a caller.
…On Mon, Oct 4, 2021, 5:28 PM Christoph M. Becker ***@***.***> wrote:
I still think that libgd should provide this info to clients, because the
client usually just includes gd.h, and not the individual headers of the
used libraries. And, at least if there are several clients who would use
this info, the same/similar code would need to be written only once.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#782 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACE6KBW5BEYRKWO6UQV66DUFF6TLANCNFSM5FGZ73RQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
this needs to be more precisely defined are we just talking about what features gd itself was configured with ? so restoring the FEATURES tracking what was dropped w/gdlib-config ? that is discussed in #345. or are you asking the gd pass along the underlying library info too ? so for libavif, it should take care of calling & passing back the libavif version ? and do so with both the compile-time & runtime settings ? that's a bit more questionable. |
@vapier exactly, it is tricky. A basic one with png: true However we need to add hash table or new structure for this. This structure will be copied/transformed anyway in the caller side to match, f.e., php hashtables or object (or lua, perl, etc) I am really not sure it is worth it. On the other hand, exposing each codec version and options using codec specific APIs makes sense. |
if it's purely informational purposes, we could include a large string. if we want something semi-programmatic, we could provide a i don't care much about that level of simple support, but expecting gd to query & expose underlying libraries directly seems too much for me. |
Frankly, I'm not sure what info to provide, and whether to add something ar all. But I really don't want clients to include headers which they would otherwise not. Maybe it's just that, in this case, PHP shouldn't bother. |
if it is only informational, easy to do as @vapier said. simple strings tuple name/value, both as string. |
Other thread suggested to use |
are you asking about gd or the underlying library ? if gd is configured to call out to the underlying library (e.g. libavif), and that library is configured in a way to not include encoders, that seems to be getting into an area i don't think gd should venture. the underlying library could be reconfigured & reinstalled with encoder support and the gd library wouldn't change. so we'd have to write custom gd code to try and query the underlying library to see what it supports, assuming of course that it even supports such introspection itself ? |
Describe the bug
There's no "introspection API" to get which formats supported and which libraries' versions provides it
Faced with it working on php/php-src#7526 - no way to get libavif version if external GD used
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The function could return some structure with library versions (not sure static/dynamic linking)
Actual results
There's no way to get supported image format and its libraries version
Environment (please complete the following information):
Additional context
Looking for helper function to debug easier dependencies
The text was updated successfully, but these errors were encountered: