Announcement

#1 2021-11-02 12:49:20

nahkampf
Member
2021-11-02
7

[resolved] "GD library is missing"

Hi, just installed Piwio and for some reason when I try to add photos (web form upload) nothing happens and it just displays the error message "GD library is missing", even though I'm running Imagick:

https://i.imgur.com/3hfTOtx.png

Offline

 

#2 2021-11-02 13:26:45

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

(Fixed it by installing php7.2-gd, and after a restart of apache I can upload photos - but Maintenance still reports me using ImageMagick.

Offline

 

#3 2021-11-02 16:37:12

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] "GD library is missing"

If the Graphics Library name is "ImageMagick" the PHP ImageMagick would be available (see admin/maintenance.php the switch (pwg_image::get_library()) and admin/include/image.class.php static function get_library() and the functions it calls) but apparently it can't be used (which is odd, maybe its installation is incomplete?), the external one's name would be "External ImageMagick", and the fallback is "GD".

If you also have the external ImageMagick installed you could try to force it using

$conf['graphics_library'] = 'ext_imagick';

in your local/config/config.inc.php (that's probably still better than using GD).
For other possible values see include/config_default.inc.php


Running Piwigo at https://erack.net/gallery/

Offline

 

#4 2021-11-02 17:30:34

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: [resolved] "GD library is missing"

[Github] Piwigo issue #957

Summary : GD is still required because it's used to resize GIF files.

Offline

 

#5 2021-11-03 00:52:29

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] "GD library is missing"

Oh, it's in the code but I haven't thought one actually uploads gifs :p


Running Piwigo at https://erack.net/gallery/

Offline

 

#6 2021-11-03 14:17:47

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

Ah, that still an issue? Jeez.

Offline

 

#7 2021-11-08 17:07:38

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: [resolved] "GD library is missing"

Actually, that's not an issue. GD is available everywhere. More than ImageMagick. Just install it and forget about this "problem" :-)

Offline

 

#8 2021-11-09 13:31:35

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

Sure, the fix is super simple, but even better would be either

a) updating the requirements to make GD required or
b) not breaking on missing GD unless we actually try to process a GIF

That makes more sense than "just install a lib you are never going to use in order for this software to work" imho :)

Offline

 

#9 2023-06-25 17:51:23

BobbyV
Member
2007-04-22
35

Re: [resolved] "GD library is missing"

Confused new user, day one.
Does this mean I have to install something, like a library?
I don't have ImageMagick, whatever that is.

Second thing I did was to click on the dashboard menu and it crashed, not a good start for me - any suggestions?
"Fatal error: Uncaught Error: Call to undefined function mb_substr() in /var/www/photos/piwigo/admin/intro.php:379 Stack trace: #0 /var/www/photos/piwigo/admin.php(345): include() #1 {main} thrown in /var/www/photos/piwigo/admin/intro.php on line 379"

Environment
Piwigo 13.7.0 Check for upgrade
Installed on 25 June 2023, 34 minutes ago
Operating system: Linux
PHP: 8.1.2-1ubuntu2.11 (Show info) [2023-06-25 17:05:54]
MySQL: 8.0.33-0ubuntu0.22.04.2 [2023-06-25 17:05:54]
Cache size N/A   never calculated Refresh
Activated plugin list0
No plugin activated

Last edited by BobbyV (2023-06-25 18:06:30)

Offline

 

#10 2023-06-25 23:33:28

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

Yup, easiest is to enable the gd and the mbstring extensions. Depending on your platform and your access level how you do that is either super simple or requires you talk to the admin of the server.

Offline

 

#11 2023-06-26 00:54:29

BobbyV
Member
2007-04-22
35

Re: [resolved] "GD library is missing"

"Yup, easiest is to enable the gd and the mbstring extensions" -- I wish I knew how.
I should have said, I'm new to Linux too!

After a lot of Googling I found a php.ini file with a "commented-out" line referring to gd so I uncommented that but with no change. This is the first time I've seen mention of mbstring, something else to Google in the morning because, as it is, it's unusable ;-)

Offline

 

#12 2023-06-26 10:16:10

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

Run

Code:

php -m

to list what modules you have enabled. You should have "mbstring" and "gd" there for piwigo to work.

Depending on your linux dist, you can probably just run (here I'm assuming you run ubuntu which uses apt):

Code:

sudo apt-get update
sudo apt-get install php-mbstring
sudo apt-get install php-gd

You might have to restart your web server for these changes to take effect, and you might have to edit your php.ini file (under "Dynamic Extensions") to uncomment mbstring or gd if they are still commented.

Check that you're editing the correct php.ini file by checking the path PHP actually uses:

Code:

php -i | grep "(php.ini)"

That will most likely give you the path that the CLI uses (eg something like /etc/php/8.1/cli/), but you want to edit the file that the web server is using (probably /etc/php/8.1/apache2/php.ini).

Hope you get it working!

Offline

 

#13 2023-06-26 12:17:31

BobbyV
Member
2007-04-22
35

Re: [resolved] "GD library is missing"

U P D A T E
It seems to have started working (for now)
Thank you so much for your patience and understanding.
I'll spend a day or two trying it out with some test images


Thanks nahkampf, very good instructions, perfect for me (I'm 70 years old) and I've made progress as the GD library error has now gone away.

Both gd and mb-string modules are now installed and uncommented in the php.ini file.
I found both the cli and apache2 versions of php.ini so played safe and edited them both (hope that was OK)

I managed to add some empty albums but any attempt to add photos causes the following errors, any idea what I might have done wrong? BTW I followed two YouTube tutorials, one installed Maria_db and the other was mySQL (I used mySQL)

MY ERRORS (I rebooted the whole computer first):
Warning: Undefined array key "setup_warnings" in /var/www/photos/piwigo/_data/templates_c/p6jhns^cebe3503676559ebb0af1e6c3fc5f7a55a36113b_0.file.photos_add_direct.tpl.php on line 488

Warning: Attempt to read property "value" on null in /var/www/photos/piwigo/_data/templates_c/p6jhns^cebe3503676559ebb0af1e6c3fc5f7a55a36113b_0.file.photos_add_direct.tpl.php on line 488

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/photos/piwigo/_data/templates_c/p6jhns^cebe3503676559ebb0af1e6c3fc5f7a55a36113b_0.file.photos_add_direct.tpl.php:488 Stack trace: #0 /var/www/photos/piwigo/include/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_64985e6a8514b2_11314190() #1 /var/www/photos/piwigo/include/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #2 /var/www/photos/piwigo/include/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render() #3 /var/www/photos/piwigo/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #4 /var/www/photos/piwigo/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute() #5 /var/www/photos/piwigo/include/template.class.php(469): Smarty_Internal_TemplateBase->fetch() #6 /var/www/photos/piwigo/include/template.class.php(392): Template->parse() #7 /var/www/photos/piwigo/admin/photos_add_direct.php(158): Template->assign_var_from_handle() #8 /var/www/photos/piwigo/admin/photos_add.php(73): include('...') #9 /var/www/photos/piwigo/admin.php(345): include('...') #10 {main} thrown in /var/www/photos/piwigo/_data/templates_c/p6jhns^cebe3503676559ebb0af1e6c3fc5f7a55a36113b_0.file.photos_add_direct.tpl.php on line 488

Last edited by BobbyV (2023-06-26 14:05:14)

Offline

 

#14 2023-06-26 15:57:28

nahkampf
Member
2021-11-02
7

Re: [resolved] "GD library is missing"

No worries, glad to be of help :)

Those last errors are "construct" errors (the code is looking for specific values or constructs but are not getting them), those are much harder to figure out (for me) without looking at the code and your environment, sadly.

Offline

 

#15 2023-06-26 18:01:20

erAck
Only trying to help
2015-09-06
1998

Re: [resolved] "GD library is missing"

That setup_warnings error stems from admin/themes/default/template/photos_add_direct.tpl that should had gotten the $setup_warnings[] array fed from admin/include/photos_add_direct_prepare.inc.php but somehow wasn't. It might be enough to remove the cached generated file _data/templates_c/p6jhns^cebe3503676559ebb0af1e6c3fc5f7a55a36113b_0.file.photos_add_direct.tpl.php so that it gets regenerated then hopefully with the proper array passed, but it may also be that hide_warnings was enabled when adding photos in which case setup_warnings is not assigned to the template, which may actually be the error here.
Just from looking at the code.. not further investigated.


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact