Error while rotating image

Phoca Gallery - image gallery extension
Adarre
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 03 Sep 2020, 15:48

Error while rotating image

Post by Adarre »

Hello,

Joomla 3.9.21.
PhocaGallery 4.3.18
PHP 7.3.21

In the Phoca Gallery Control Panel, I have an error when I want to rotate an image :

Error while rotating image
ErrorNoImageCreateTruecolor


On the same server I have other websites where it works fine.

Any explanation ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error while rotating image

Post by Jan »

Hi, try to open this file:

administrator\components\com_phocagallery\libraries\phocagallery\image\imagerotate.php

and on line cca 212 delete the symbol "@"

FROM:

Code: Select all

$image3 = @ImageCreateTruecolor($dst[2], $dst[3]);
TO:

Code: Select all

$image3 = ImageCreateTruecolor($dst[2], $dst[3]);
Maybe you will get more detailed information about the error from your system. :idea:
(of course PHP error reporting needs to be enabled to get the error message)

Jan
If you find Phoca extensions useful, please support the project
Adarre
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 03 Sep 2020, 15:48

Re: Error while rotating image

Post by Adarre »

Hi, thank you for the answer

I have the following line in my logs

Code: Select all

mod_fcgid: stderr: PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /var/www/vhosts/sample.com/httpdocs/administrator/components/com_phocagallery/libraries/phocagallery/image/imagerotate.php on line 212, referer: https://www.sample.com/administrator/index.php?option=com_phocagallery&view=phocagalleryimgs
The problem arises for all images. As already said, I don't have this problem on other sites installed on the same server.

Vincent.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error while rotating image

Post by Jan »

Hi, this can be related to only one image which can have some wrong format. Are you able to see which image is managed when this error occurs?

Jan
If you find Phoca extensions useful, please support the project
Adarre
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 03 Sep 2020, 15:48

Re: Error while rotating image

Post by Adarre »

Hi.

The problem arises for all images, without exception. Including new images that I just uploaded.

Vincent.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error while rotating image

Post by Jan »

Are you able to debug the variable on line 212? E.g. with print_r?

Image

administrator\components\com_phocagallery\libraries\phocagallery\image\imagerotate.php

Jan
If you find Phoca extensions useful, please support the project
Post Reply