When trying to load large files that require more memory that is currently allocated to PHP, PHPWebGallery simply gives a blank page instead of giving some kind of useful information.
Steps to reproduce: 1) Load a file that requires more memory than PHP has available. Note that this doesn't have to be a large-sized file. Although the size is well below the memory limit, if the dimensions or resolution is high, it will gobble up a lot of memory.
Attempt to create a thumbnail of the file
You are greeted with a blank screen and confused user
Additional information: When I first hit this error, I just gave up on PhpWebGallery and tried a different piece of software. However, I really liked PhpWebGallery so I came back to it and found the root of the problem.
In admin/thumbnail.php, apply the following patch:
**Reported by linuxlefty on 13 Apr 2008 08:35**
**Version:** 1.7.1
When trying to load large files that require more memory that is currently allocated to PHP, PHPWebGallery simply gives a blank page instead of giving some kind of useful information.
**Steps to reproduce:** 1) Load a file that requires more memory than PHP has available. Note that this doesn't have to be a large-sized file. Although the size is well below the memory limit, if the dimensions or resolution is high, it will gobble up a lot of memory.
2) Attempt to create a thumbnail of the file
3) You are greeted with a blank screen and confused user
**Additional information:** When I first hit this error, I just gave up on PhpWebGallery and tried a different piece of software. However, I really liked PhpWebGallery so I came back to it and found the root of the problem.
In admin/thumbnail.php, apply the following patch:
50,63d49
< $imageInfo = getimagesize($path);
< $memoryNeeded = round(
< (
< $imageInfo[0] \* $imageInfo[1] \* $imageInfo['bits'] \* $imageInfo['channels'] / 8 + 65536 ) /\* memory needed _/
< \* 1.5 /_ fudge factor _/
< / (1024_1024) /\* convert from bytes => MB */
< );
< $memoryAvialable = substr( ini_get('memory_limit'), 0, -1 );
<
< if ( $memoryNeeded > $memoryAvialable )
< {
< echo ("ERROR: Unable to create thumbnail of $path. Image requires too much memory.<br />");
< return;
< }
basically, it calculates the needed memory and alerts the user if there won't be enough memory available.
[Piwigo Bugtracker #820](http://piwigo.org/bugs/view.php?id=820)
<!-- github-sync-id:97225501 -->
**Comment posted by linuxlefty on 13 Apr 2008 11:15**
I forgot to add, the code is based off of comments I read at: http://cn2.php.net/imagecreatefromjpeg
<!-- github-comment-id:124890715 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reported by linuxlefty on 13 Apr 2008 08:35
Version: 1.7.1
When trying to load large files that require more memory that is currently allocated to PHP, PHPWebGallery simply gives a blank page instead of giving some kind of useful information.
Steps to reproduce: 1) Load a file that requires more memory than PHP has available. Note that this doesn't have to be a large-sized file. Although the size is well below the memory limit, if the dimensions or resolution is high, it will gobble up a lot of memory.
Attempt to create a thumbnail of the file
You are greeted with a blank screen and confused user
Additional information: When I first hit this error, I just gave up on PhpWebGallery and tried a different piece of software. However, I really liked PhpWebGallery so I came back to it and found the root of the problem.
In admin/thumbnail.php, apply the following patch:
50,63d49
< $imageInfo = getimagesize($path);
< $memoryNeeded = round(
< (
< $imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $imageInfo['channels'] / 8 + 65536 ) /* memory needed /
< * 1.5 / fudge factor _/
< / (1024_1024) /* convert from bytes => MB */
< );
< $memoryAvialable = substr( ini_get('memory_limit'), 0, -1 );
<
< if ( $memoryNeeded > $memoryAvialable )
< {
< echo ("ERROR: Unable to create thumbnail of $path. Image requires too much memory.<br />");
< return;
< }
basically, it calculates the needed memory and alerts the user if there won't be enough memory available.
Piwigo Bugtracker #820
Comment posted by linuxlefty on 13 Apr 2008 11:15
I forgot to add, the code is based off of comments I read at: http://cn2.php.net/imagecreatefromjpeg
Comment posted by VDigital on 31 Mar 2010 19:39
Up! For Piwigo 2.x ???