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

tcl.gd doesn't properly detect if gd has jpeg/png/gif support in linux/docker #4

Closed
zeroschism opened this issue Dec 17, 2019 · 5 comments · Fixed by #5
Closed

tcl.gd doesn't properly detect if gd has jpeg/png/gif support in linux/docker #4

zeroschism opened this issue Dec 17, 2019 · 5 comments · Fixed by #5

Comments

@zeroschism
Copy link

zeroschism commented Dec 17, 2019

hammu tcl.gd % GD create_from_jpeg
GD library not built with JPEG support
while evaluating GD create_from_jpeg
hammu tcl.gd % GD create_from_gif
GD library not built with GIF support
while evaluating GD create_from_gif
hammu tcl.gd % GD create_from_png
GD library not built with PNG support
while evaluating GD create_from_png

yet:

# dpkg --list | egrep "(png|jpeg|gif)"
ii  libgif-dev                             5.1.4-2ubuntu0.1                  amd64        library for GIF images (development)
ii  libgif7:amd64                          5.1.4-2ubuntu0.1                  amd64        library for GIF images (library)
ii  libjpeg-dev:amd64                      8c-2ubuntu8                       amd64        Independent JPEG Group's JPEG runtime library (dependency package)
ii  libjpeg-turbo8:amd64                   1.5.2-0ubuntu5.18.04.3            amd64        IJG JPEG compliant runtime library.
ii  libjpeg-turbo8-dev:amd64               1.5.2-0ubuntu5.18.04.3            amd64        Development files for the IJG JPEG library
ii  libjpeg8:amd64                         8c-2ubuntu8                       amd64        Independent JPEG Group's JPEG runtime library (dependency package)
ii  libjpeg8-dev:amd64                     8c-2ubuntu8                       amd64        Independent JPEG Group's JPEG runtime library (dependency package)
ii  libpng-dev:amd64                       1.6.34-1ubuntu0.18.04.2           amd64        PNG library - development (version 1.6)
ii  libpng-tools                           1.6.34-1ubuntu0.18.04.2           amd64        PNG library - tools (version 1.6)
ii  libpng16-16:amd64                      1.6.34-1ubuntu0.18.04.2           amd64        PNG library - runtime (version 1.6)```
@bovine
Copy link
Member

bovine commented Dec 18, 2019

It uses libgd, not any of those libraries.

Check the contents of the installed gd.h to see if it references GD_GIF, GD_PNG, or GD_JPEG

@snoe925
Copy link

snoe925 commented Dec 18, 2019

This appears related to the deprecation of gdlib-config and the wrapper script placed in this repository. The pkg-config mechanism is not working right. It think the names of the defines might need be the standard GD_PNG -> HAVE_LIBPNG. In the generic/tclgd.c

@snoe925
Copy link

snoe925 commented Dec 18, 2019

The png-config actually does nothing as CFLAGS is empty. In either case I would expect a modern define to be HAVE_LIBPNG instead of GD_PNG.

# pkg-config --modversion gdlib
2.2.5
# pkg-config --cflags gdlib
#

@gromgit
Copy link

gromgit commented Aug 4, 2020

It uses libgd, not any of those libraries.

That's only true for GIF, and it's always included, so the #ifndef GD_GIF tests in generic/tclgd.c are defunct.

@gromgit
Copy link

gromgit commented Aug 4, 2020

As for the other file formats, upstream has declared in libgd/libgd#345 that all format-specific functions will at least be stubbed for linking purpose, so the official feature detection method is to call gdSupportsFileType at runtime.

gromgit pushed a commit to gromgit/tcl.gd that referenced this issue Aug 4, 2020
The official libgd way is to call gdSupportsFileType() at run time. This always ensures correct results, as the underlying library can change configuration independently of this extension.

Also fixed `GD features` command, to return a list of supported extensions.

Closes flightaware#4.
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 a pull request may close this issue.

4 participants