Re: GD module has no support for animated gifs
by syphilis (Archbishop) on Dec 23, 2025 at 07:56 UTC
|
GD is up to date. (2.83).
The complaint is not about the version of the GD module that you have installed.
Instead it's about the version of the libgd library against which your GD-2.83 module has been built.
To find out what version of libgd was used, try running:
perl -MGD -le "print GD::LIBGD_VERSION;"
That should show you that libgd is at a version less than 2.0.33.
The solution is to install a version of the GD perl module (version 2.83 would be fine, but older versions would also suffice) that has been built against libgd-2.0.33 or later.
Cheers,
Rob
| [reply] [d/l] |
|
|
yes, when i run that command it says 2.0303. You said to install a version of GD that has been built against libgd-2.0.33 or later but how would i do that?
I used the cpan command cpanm GD to download the module, in case that matters.
| [reply] |
|
|
Install an up to date version of libgd on your system, then use cpan to build the perl module GD against it. You haven't specified which OS you are on, if it has a package manager you should be able to install it from there:
sudo pacman -S gd
[sudo] password for marto:
warning: gd-2.3.3-9 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Package (1) Old Version New Version Net Change
extra/gd 2.3.3-9 2.3.3-9 0.00 MiB
Then just reinstall the module using cpan or otherwise. If on windows see instructions at https://github.com/libgd/libgd, or consider using Strawberry perl with all this sort of thing included.
Update: Sorry, just noticed the 'c:\' above. | [reply] [d/l] [select] |
|
|
|
|
|
Re: GD module has no support for animated gifs
by haj (Vicar) on Dec 23, 2025 at 19:39 UTC
|
I recall having done animated GIF with GD... but the same program fails to run on my current machine with the error you reported.
My guess is that the version check is broken: libgd version 2.3.3 reports itself as 2.0303. Perl people should be well aware about version numbers with zeroes and the problems of comparing them.
Contrary to what other monks are saying about "too old", I'd rather try to install an older version of Strawberry Perl. They all come with a version of libgd, for example Strawberry Perl 5.32 has libgd 2.2.5, and if I recall correctly, I did my animated GIF with 5.32.
| [reply] |
Re: GD module has no support for animated gifs
by pryrt (Abbot) on Dec 23, 2025 at 21:44 UTC
|
So, I found a few extra minutes today.
It's not actually libgd that needs to be customized, but the installation of the GD library: I had to manually configure the Makefile.PL options, and I had to tweak the Makefile.PL, because I couldn't figure out how to disable HAVE_GD2 option from the command-line, and it would auto-use that, causing a test failure.
Using cpanm as my client, I followed the following procedure:
- cpanm --uninstall GD
this will make sure your old setup of GD is removed first
- cpanm --look GD
gets into a directory where you can do the manual build
- perl Makefile.PL
it will ask to confirm libgd location; it should be right, if you're in strawberry, so you can just hit ENTER. Copy the at the "Included Features" line, and strip out all the GD_ prefixes; add in GIFANIM right after GIF in the list.
- edit Makefile.PL
comment out the $DEFINES .= ' -DHAVE_GD2' if $HAVE_GD2; line (there might be a way to force that from options, but I didn't have a chance to experiment with that)
- perl Makefile.PL --options="GIF GIFANIM OPENPOLYGON ZLIB PNG FREETYPE FONTCONFIG JPEG XPM TIFF WEBP AVIF HEIF UNCLOSEDPOLY FTCIRCLE VERSION_33 WINDOWS_BMP"
where the options are the SPACE-separated list that you got from the earlier step (this is just my example)
- gmake test
this runs the test; it should pass. (If you don't disable the HAVE_GD2, it will fail the GD.t test)
- gmake install
this installs it
- exit
this gets out of the cpanm --look environment
- perl -MGD -le "print for GD::LIBGD_VERSION, GD::VERSION_STRING"
this should show 2.0303 and 2.3.3
- perldoc GD::Image
this should list that includes formats like PNG, JPEG, GIF, and GifAnim. It should exclude GD and GD2.
At this point, I can successfully run one of my scripts that creates an animated GIF, whereas I couldn't earlier today.
| [reply] [d/l] [select] |
|
|
At this point, I can successfully run one of my scripts that creates an animated GIF, whereas I couldn't earlier today.
Nice work !!
I noticed that SP stopped providing the GD module after the 5.38.x releases - though libgd is still being provided.
That seems odd, so I've taken the liberty of opening https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/285, where I've linked to pryrt's post.
Hopefully, SP will, in future, again include a serviceable GD module in vendor/lib.
Cheers, Rob
| [reply] |
Re: GD module has no support for animated gifs
by Anonymous Monk on Dec 23, 2025 at 22:06 UTC
|
(not the OP-AM, just my 2c; and I wrote this just before pryrt provided better answer, but anyway)
Unlike e.g. SP 5.32, the latest SPs (e.g. 5.42) ship without the "c/bin/gdlib-config.bat" file. Perhaps an oversight by SP maintainers.
Without it, the "GD/Makefile.PL" assumes the worst on how GD was compiled, i.e. no GIF animation support. Imho, it's somewhat sloppy and convoluted anyway (see e.g. line #566) (another example: in absence of "gdlib-config", it seems to both find and _not_ to find the "c/lib/pkgconfig/gdlib.pc" file at the same time; it's quite messy).
So, to untangle everything properly seems like too heavy a task; what I did is just inject "GD_GIFANIM" into a list at line #628; and then "cpanm ." It installs smoothly and I've managed to create a simple animated GIF.
| [reply] |
Re: GD module has no support for animated gifs
by Anonymous Monk on Dec 24, 2025 at 08:50 UTC
|
I have uninstalled and reinstalled strawberry perl. version 5.32. Everything is ok now, tx.
| [reply] |
Re: GD module has no support for animated gifs
by Anonymous Monk on Dec 24, 2025 at 07:35 UTC
|
Ty for the information, i will see if i get it running.
| [reply] |