imagemagic.php Error on line 220

Phoca Gallery - image gallery extension
pdenessen
Phoca Member
Phoca Member
Posts: 12
Joined: 16 Jul 2009, 11:58

Re: imagemagic.php Error on line 220

Post by pdenessen »

Yep:

Fatal error: Out of memory (allocated 44040192) (tried to allocate 13824 bytes) in /mnt/web5/12/73/52092673/htdocs/administrator/components/com_phocagallery/libraries/phocagallery/image/imagemagic.php on line 220

If you want I can sent you PM with the link to the backend.

Patrick
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: imagemagic.php Error on line 220

Post by Jan »

Hi, no idea what can be wrong there :idea: as I am not server expert, i really don't know what can be the problem with the memory there ? this problem is caused when the script (php function) try to use GD on the server. So what can be wrong:

- script (tested on many servers by many users)
- memory or php settings
- GD settings
- server settings ?
If you find Phoca extensions useful, please support the project
pdenessen
Phoca Member
Phoca Member
Posts: 12
Joined: 16 Jul 2009, 11:58

Re: imagemagic.php Error on line 220

Post by pdenessen »

I had the problem already solved.

I added the line
upload_max_filesize = 4M

to my php.ini settings.

This means that the uploaded files in my case may not be bigger then 4MB. I do not not what the default setting is when leaving this parameter.

Although it would be better, if the program could give a "good" error message pointing to this problem.

@ Jan : Can you have a look at it

thx

Patrick
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: imagemagic.php Error on line 220

Post by Jan »

Hi, fatal errors cannot be managed, if you run script and it does not have enough php memory to run, you get fatal error and you have not memory to catch the error. :-(

Jan
If you find Phoca extensions useful, please support the project
pdenessen
Phoca Member
Phoca Member
Posts: 12
Joined: 16 Jul 2009, 11:58

Re: imagemagic.php Error on line 220

Post by pdenessen »

Is there no way to check the image-size against the php settings bedore the scripts runs?
It is not nice when a program crashes, and I think that the user should be warned before.
Is it else possible to add this to a system check, where the program checks all kind of settings ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: imagemagic.php Error on line 220

Post by Jan »

Hi, as I wrote above, you cannot manage fatal errors, you cannot check for fatal error :-(

User cannot be warned before, because there are millions severs with millions of possible settings so you cannot make some limit because you don't know on which server on which settins the application will be run.

So if you have some standard server you can make thumbnails e.g. from images 3072x2304 but if you server doesn't have enough php memory and CPU, then your server will return fatal error - this cannot be managed and cannot be know before...

So it depends on administrator to prevent from possible fatal errors. He/she can set:

- maximum file size for upload
- maximum resolution of an image - width
- maximum resolution of an image - height, ...

So if administrator knows, the server can have problems with php memory, he/she should reduce these parameters

Jan
If you find Phoca extensions useful, please support the project
luisraposo
Phoca Member
Phoca Member
Posts: 16
Joined: 22 Aug 2009, 17:35
Location: Portugal
Contact:

Re: imagemagic.php Error on line 220

Post by luisraposo »

hello Jan,
just to mention that with latest version 2.6.1 of the component, this error exists no more.
good work!

luis raposo
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: imagemagic.php Error on line 220

Post by Jan »

Great to hear it. Jan
If you find Phoca extensions useful, please support the project
mamool
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 18 Oct 2010, 16:31

Re: imagemagic.php Error on line 220

Post by mamool »

hi
i use phocagallery 2.7.2
and joomla 1.5.21

i got this error : Fatal error: Out of memory (allocated 64749568) (tried to allocate 17280 bytes) in /home/aria/public_html/fa/administrator/components/com_phocagallery/libraries/phocagallery/image/imagemagic.php on line 216

my memory_limit : 64 MB
i change the code in imagemagic.php:
if ($memory < 50) {
ini_set('memory_limit', '50M');
$memoryLimitChanged = 1;
}
to
if ($memory < 128) {
ini_set('memory_limit', '128M');
$memoryLimitChanged = 1;
}
but it dosent work
i access to my php.ini file , i incress the memory_limit to 128MB , but i got same error
please help me
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: imagemagic.php Error on line 220

Post by Jan »

Hi, maybe this is still not enough for your images, try to check the resolution of your images. GD library on your server seems cannot work them.

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