Fatal error Thumbnails Creation

Phoca Gallery - image gallery extension
Jimbo
Phoca Member
Phoca Member
Posts: 39
Joined: 03 May 2008, 13:31
Contact:

Fatal error: Allowed

Post by Jimbo »

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12288 bytes) in /administrator/components/com_phocagallery/helpers/phocagallery.php on line 619

why phocagallery needs more then 32MB memory?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Phoca Gallery doesn&

Post by Jan »

Phoca Gallery doesn't need it... The thumbnails are created by your GD library on your Server...
If you find Phoca extensions useful, please support the project
Jimbo
Phoca Member
Phoca Member
Posts: 39
Joined: 03 May 2008, 13:31
Contact:

if you are right, th

Post by Jimbo »

if you are right, then why GD library needs more then 32MB memory?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

I am right, because

Post by Jan »

I am right, because Phoca Gallery cannot create the thumnails Thumbnails are made by your server, by GD library ...

GD library (extension of PHP) needs so much RAM and CPU because it is not so easy to work with an image, so the computer (server) needs so much RAM for work with it (e.g. resampling of an image takes a lot of RAM and CPU) ... This is the same question why the Windows XP or some Linux distribution need e.g. 256 MB RAM to work... Try to resample some image (e.g. image with 1.2 MB which was created by a camera) by some old computer with 8 MB RAM ... I think it will not work ...
If you find Phoca extensions useful, please support the project
Jimbo
Phoca Member
Phoca Member
Posts: 39
Joined: 03 May 2008, 13:31
Contact:

my webhost said its

Post by Jimbo »

my webhost said its just bad coding, and that your component should free memory in the process (by the way its not 8 its 32 MB)

is it true?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Did your webhost see

Post by Jan »

Did your webhost see the code? If yes, understand your webost his own work? If no, does he tell lies?

First, Phoca Gallery finds out, how much RAM you have available:
If less than 50, Phoca Gallery will try to set 50 MB RAM for Image creating (if function ini_set is disabled, you cannot create the thumnails, because GD need this RAM). After setting the 50 MB of RAM, GD function can create the thumbnails....

After thumbnail creating, Phoca Gallery will set the RAM back to your value in case your value was smaller than 50 MB

But before setting back the RAM, ImageDestroy function will be used... This function free the memory...

If Multiple Add is used, the same happens BUT after 1 image creating, it comes the http redirect, so new script will be called (it means, the memory must be free: IMAGE DESTROYING + RAM SETTING BACK + LEAVING THE SCRIPT)

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