samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Untraceable Memory Error #400

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Set error_reporting = E_ALL in php.ini
2.  Set the Memory Limit Low
3.  Upload large images (The up-loader should timeout/fail/go blank and no 
errors shown/thrown)
3.  Goto the gallery you uploaded the pictures too. (The thumbs should all be 
broken images)
4.  Look in Apache's (PHP's) error log, there should be nothing.
5.  Go to the options and watrermark tab.
6.  The rendered image for that gallery should display a fatal error about 
memory. (hinted me to the problem)

What is the expected output? What do you see instead?
Some sort of error thrown.

What version of the product are you using? On what operating system?
Wordpress Version 3.2.1 
NGG Version 1.8.2

Please provide any additional information below.
(PHPINFO INFO_ALL ATTACHED) PHP Version 5.3.3-1ubuntu9.5

Original issue reported on code.google.com by phpmails...@gmail.com on 4 Aug 2011 at 9:05

Attachments:

GoogleCodeExporter commented 8 years ago
It's hard to catch each error message, but if I can determine a memory error , 
then it will be shown

Original comment by alex.cologne on 6 Aug 2011 at 7:13

GoogleCodeExporter commented 8 years ago
I have found the problem.

In lib/gd.thumbnail.inc.php @ line 235 you get the memory limit.  However, if 
-1 is specified, it fails.  

http://www.php.net/manual/en/ini.core.php#ini.memory-limit

"This sets the maximum amount of memory in bytes that a script is allowed to 
allocate. This helps prevent poorly written scripts for eating up all available 
memory on a server. Note that to have no memory limit, set this directive to 
-1."

When -1 is called, implementing memory_get_peak_usage 
(http://www.php.net/manual/en/function.memory-get-peak-usage.php) would 
probably be the best solution.

Hope this helps!

Original comment by phpmails...@gmail.com on 22 Aug 2011 at 11:54