Page 2 of 2

Re: Problem: Blank images + PHP Memory Limit

Posted: 15 Jul 2011, 23:39
by CedricVF
Yes, substantially so.

Re: Problem: Blank images + PHP Memory Limit

Posted: 21 Jul 2011, 17:59
by Jan
CedricVF wrote:They upped it to 64M - same problem. It is not only the thumbnail creation that is the problem, all my added images are blank too (whichever way I upload them).

The error message always says there is 20MB allocated, no matter what they set it as server-side.

This was my last communication from my host:
Given that the script seems unable to allocate memory above 20MB, I'd assume there's something non-functional about it (perhaps it has its own memory limit set somewhere?). At any rate, without a clue from the developers of this script as to what may be causing this I'm uncertain what further adjustments at a server level to make.

Hi, mostly Phoca Gallery does not need so much memory, it only list items from the database.
The place where there is needed a memory is creating the thumbnails. But all this depends on GD library on the server. Phoca Gallery itself does not create thumbnails, it only says to GD, do a thumbnail and do only one image per script so there is enough time and enough memory to do it (search other similar posts which were solved)

In fact, if there is a php memory error exactly while creating thumbnails by GD library:

- the memory limit must be increased
- or the images must be smaller, mostly images on the web should be smaller then 2MB, larger images could not be handled on many servers (because of memory issues - servers are not like PCs)

I am running Phoca Gallery on 16MB on the server. Phoca Gallery tries to increase memory limit to 50 MB and set it back after creating thumbnails. If this is not allowed on the server, then it must be increased memory for the whole scripts on the server :-(


But as written, memory limit cannot be handled by the component, GD library needs so much memory for creating thumnails and component cannot do nothing with this demand :-(

Jan

Re: Problem: Blank images + PHP Memory Limit

Posted: 24 Jul 2011, 22:46
by CedricVF
Okay, here is the most recent communication from my host:
It looks like phocagallery's got some ini_set statements inside its code to set memory limits - that's likely to be where the fault lies.

You'll need to check with the developers for the best way of amending these so they function properly; it's their code that's artificially lowering the available RAM for PHP.
The "ini_set" value in imagemagic.php is set to 48M. Is there something else that should be changed within the PG scripts?

Cheers...

Re: Problem: Blank images + PHP Memory Limit

Posted: 25 Jul 2011, 02:54
by CedricVF
Very strange. I have done a totally fresh Joomla install, installed Phoca Gallery and tried to add images (using Multiple Add; there were 10 or so). It worked for the first image (thumbnail created fine, full image viewable) before keeling over and spitting out the same error. My PHP mem_limit is set to 64M server side, and the error now shows 64M limit as opposed to the problematic value of 20M.

One step closer at least!

So, I deleted all but that first one and tried again. This time it created 8 of 9 thumbs before it died.

Is this info of any use? It is certainly better than it was but not functional enough to use.

Re: Problem: Blank images + PHP Memory Limit

Posted: 25 Jul 2011, 16:46
by CedricVF
Got it working with significantly smaller images (PHP mem_limit is now 98M or something but this is irrelevant).

Would it be possible to upload smaller images so PG creates the resized versions, and then overwrite the "original" images with high resolution versions? So people can still download full res ones. This would be a work around I would like, rather than linking each image to an external file each time. Did that make sense?

Re: Problem: Blank images + PHP Memory Limit

Posted: 25 Jul 2011, 17:00
by Jan
Hi, yes you can overwrite the originals then per ftp.

Jan

Re: Problem: Blank images + PHP Memory Limit

Posted: 25 Jul 2011, 17:58
by CedricVF
Great stuff, that's me happy enough. This is actually a better way for me to do it as some of the images could be huge.

You can mark this as Solved (I would, but I can't see how, lol). Thanks, Jan.

Re: Problem: Blank images + PHP Memory Limit

Posted: 26 Jul 2011, 00:30
by Jan
Ok