Announcement

  •  » Extensions
  •  » [Header Manager] Fatal error after Submit

#1 2022-05-24 15:23:23

matthys
Member
2014-04-02
148

[Header Manager] Fatal error after Submit

Never noticed this before but I tried to upload banner via the Header Manager plugin and got:

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($function) must be a valid callback, class image_imagick does not have a method "get_resize_result" in /xxx/admin/include/image.class.php:78 Stack trace: #0 /xxx/plugins/header_manager/include/banner.class.php(32): pwg_image->__call() #1 /xxx/plugins/header_manager/admin/add.php(24): banner_image->banner_resize() #2 /xxx/plugins/header_manager/admin.php(28): include('...') #3 /xxx/admin/plugin.php(53): include_once('...') #4 /xxx/admin.php(320): include('...') #5 {main} thrown in /xxx/admin/include/image.class.php on line 78

Any clue what this can be? I tried with and without selecting Respect xx aspect ratio.

Piwigo 12.2.0
Operating system: Linux
PHP: 8.0.8 (Show info) [2022-05-24 15:22:00]
MySQL: 8.0.29-0ubuntu0.21.10.2 [2022-05-24 15:22:00]
Graphics Library: ImageMagick 6.9.11-60

Offline

 

#2 2022-05-25 07:13:28

I_am_cats
Member
2022-04-14
27

Re: [Header Manager] Fatal error after Submit

matthys wrote:

Never noticed this before but I tried to upload banner via the Header Manager plugin and got:

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($function) must be a valid callback, class image_imagick does not have a method "get_resize_result" in /xxx/admin/include/image.class.php:78 Stack trace: #0 /xxx/plugins/header_manager/include/banner.class.php(32): pwg_image->__call() #1 /xxx/plugins/header_manager/admin/add.php(24): banner_image->banner_resize() #2 /xxx/plugins/header_manager/admin.php(28): include('...') #3 /xxx/admin/plugin.php(53): include_once('...') #4 /xxx/admin.php(320): include('...') #5 {main} thrown in /xxx/admin/include/image.class.php on line 78

Any clue what this can be? I tried with and without selecting Respect xx aspect ratio.

Piwigo 12.2.0
Operating system: Linux
PHP: 8.0.8 (Show info) [2022-05-24 15:22:00]
MySQL: 8.0.29-0ubuntu0.21.10.2 [2022-05-24 15:22:00]
Graphics Library: ImageMagick 6.9.11-60

Are you sure imagemagick's php bindings are also installed*?
Has imagemagick stuff worked before? Have there been server updates?
I searched for "php class image_imagick does not have a method get_resize_result" but I get nothing. Are you sure image_imagick is correct?


* My VPS says this:

Code:

dpkg -l | grep -i magick
ii  graphicsmagick                        1.4+really1.3.35-1                                                   amd64        collection of image processing tools
ii  imagemagick                           8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        image manipulation programs -- binaries
ii  imagemagick-6-common                  8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          image manipulation programs -- infrastructure
ii  imagemagick-6.q16                     8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        image manipulation programs -- quantum depth Q16
ii  libgraphicsmagick-q16-3               1.4+really1.3.35-1                                                   amd64        format-independent image processing - C shared library
ii  libimage-magick-perl                  8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          Perl interface to the ImageMagick graphics routines
ii  libimage-magick-q16-perl              8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        Perl interface to the ImageMagick graphics routines -- Q16 version
ii  libmagickcore-6-arch-config:amd64     8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        low-level image manipulation library - architecture header files
ii  libmagickcore-6-headers               8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          low-level image manipulation library - header files
ii  libmagickcore-6.q16-6:amd64           8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        low-level image manipulation library -- quantum depth Q16
ii  libmagickcore-6.q16-6-extra:amd64     8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        low-level image manipulation library - extra codecs (Q16)
ii  libmagickcore-6.q16-dev:amd64         8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        low-level image manipulation library - development files (Q16)
ii  libmagickcore-dev                     8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          low-level image manipulation library -- dummy package
ii  libmagickwand-6-headers               8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          image manipulation library - headers files
ii  libmagickwand-6.q16-6:amd64           8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        image manipulation library -- quantum depth Q16
ii  libmagickwand-6.q16-dev:amd64         8:6.9.10.23+dfsg-2.1ubuntu11.4                                       amd64        image manipulation library - development files (Q16)
ii  libmagickwand-dev                     8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          image manipulation library -- dummy package
ii  perlmagick                            8:6.9.10.23+dfsg-2.1ubuntu11.4                                       all          Perl interface to ImageMagick -- dummy package
ii  php7.3-imagick                        3.6.0-4+ubuntu20.04.1+deb.sury.org+10                                amd64        Provides a wrapper to the ImageMagick library
ii  php7.4-imagick                        3.6.0-4+ubuntu20.04.1+deb.sury.org+10                                amd64        Provides a wrapper to the ImageMagick library
ii  php8.0-imagick                        3.6.0-4+ubuntu20.04.1+deb.sury.org+10                                amd64        Provides a wrapper to the ImageMagick library
ii  php8.1-imagick                        3.6.0-4+ubuntu20.04.1+deb.sury.org+10                                amd64        Provides a wrapper to the ImageMagick library

Offline

 

#3 2022-05-25 09:53:52

matthys
Member
2014-04-02
148

Re: [Header Manager] Fatal error after Submit

I check and this is what I got:

Code:

 dpkg -l | grep -i magick
ii  imagemagick                           8:6.9.11.60+dfsg-1ubuntu1                    amd64        image manipulation programs -- binaries
ii  imagemagick-6-common                  8:6.9.11.60+dfsg-1ubuntu1                    all          image manipulation programs -- infrastructure
ii  imagemagick-6.q16                     8:6.9.11.60+dfsg-1ubuntu1                    amd64        image manipulation programs -- quantum depth Q16
rc  imagemagick-common                    8:6.9.7.4+dfsg-3ubuntu1                      all          image manipulation programs -- infrastructure dummy package
ii  libmagickcore-6.q16-6:amd64           8:6.9.11.60+dfsg-1ubuntu1                    amd64        low-level image manipulation library -- quantum depth Q16
ii  libmagickcore-6.q16-6-extra:amd64     8:6.9.11.60+dfsg-1ubuntu1                    amd64        low-level image manipulation library - extra codecs (Q16)
ii  libmagickwand-6.q16-6:amd64           8:6.9.11.60+dfsg-1ubuntu1                    amd64        image manipulation library -- quantum depth Q16
ii  php-imagick                           3.4.4+php8.0+3.4.4-2+deb11u2ubuntu1          amd64        Provides a wrapper to the ImageMagick library

So I would say, YES.

PS .. I got Ubuntu 21.10 Server

Last edited by matthys (2022-05-25 09:55:45)

Offline

 

#4 2022-05-25 10:03:18

matthys
Member
2014-04-02
148

Re: [Header Manager] Fatal error after Submit

I also check the /xxx/admin/include/image.class.php and there is the mentioned image_imagick.

Not sure when this happened, I did move to PHP8 with Ubuntu 21.10 and got all kind of problems.

Offline

 

#5 2022-05-26 08:54:06

I_am_cats
Member
2022-04-14
27

Re: [Header Manager] Fatal error after Submit

Sorry about imagick vs. magick - I should've looked closer at my own output!

matthys wrote:

I also check the /xxx/admin/include/image.class.php and there is the mentioned image_imagick.
Not sure when this happened, I did move to PHP8 with Ubuntu 21.10 and got all kind of problems.

My VPS also moved to new versions of almost everything, it moved from Debian 9 to Ubuntu 20.04 LTS.
That might account for the many different versions of php-imagick currently installed.
But even so, you should check if you cannot solve your problem by explicitely installing the php imagick package for the currently active PHP version.

Also have a look at server logs if you have access to them.

Are you aware that you are currently running a beta verison of Ubuntu?
Esp. for servers I would only ever recommend LTS.

PS: you might want to purge imagemagick-common.

Last edited by I_am_cats (2022-05-26 08:59:09)

Offline

 

#6 2022-05-27 07:52:02

matthys
Member
2014-04-02
148

Re: [Header Manager] Fatal error after Submit

I_am_cats wrote:

Esp. for servers I would only ever recommend LTS.

I indeed want to move to latest LTS, but Ubuntu 22.04 LTS (Jammy Jellyfish) has PHP8.1 which gives some problems with Piwigo.... so currently waiting for the upgrade. And PHP7.4 will be EOL in November THIS year.

Offline

 

#7 2022-05-27 11:28:39

erAck
Only trying to help
2015-09-06
1395

Re: [Header Manager] Fatal error after Submit

That's still 6 months you can hope for Piwigo finally getting ready for PHP 8.0.
And you could install/run two PHP versions in parallel so waiting with the upgrade because of an older PHP version needed isn't necessary.


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

Offline

 

#8 2022-05-29 12:16:20

I_am_cats
Member
2022-04-14
27

Re: [Header Manager] Fatal error after Submit

matthys wrote:

I_am_cats wrote:

Esp. for servers I would only ever recommend LTS.

I indeed want to move to latest LTS, but Ubuntu 22.04 LTS (Jammy Jellyfish) has PHP8.1 which gives some problems with Piwigo.... so currently waiting for the upgrade. And PHP7.4 will be EOL in November THIS year.

If the package is provided by your distro, I would only worry about the distro's assessment on when it's EOL.
BTW, 20.04.4 LTS still has another 3 years to go, and 18.04.6 LTS still another year:
https://wiki.ubuntu.com/Releases

Offline

 

#9 2022-06-01 09:43:22

matthys
Member
2014-04-02
148

Re: [Header Manager] Fatal error after Submit

Hmmmmmm ... not sure but it works when I disabled line 78 in /xxx/admin/include/image.class.php as mentioned in the error message.

Not sure what is wrong with it (line 78);

Code:

//    return call_user_func_array(array($this->image, $method), $arguments);

Offline

 

#10 2022-06-01 15:27:54

erAck
Only trying to help
2015-09-06
1395

Re: [Header Manager] Fatal error after Submit

That probably disables more than you want. Untested, but you could try to change that to

Code:

    if (method_exists($this->image, $method))
    {
      return call_user_func_array(array($this->image, $method), $arguments);
    }

I'd assume the
private function get_resize_result()
should be called there, but I have no clue how that is supposed to work.

Instead you could also try to force the image library to external ImageMagick by specifying in local config

Code:

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

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

Offline

 

#11 2022-06-04 16:04:51

matthys
Member
2014-04-02
148

Re: [Header Manager] Fatal error after Submit

Yes, I went back as now after uploading new image it's not resized.

So, only a problem for Header Manager it seems... even if resizing is not needed when the banner has the correct dimensions (as in my case).

Last edited by matthys (2022-06-04 16:06:26)

Offline

 
  •  » Extensions
  •  » [Header Manager] Fatal error after Submit

Board footer

Powered by FluxBB

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