Fixed Upload limit issue

ak38

Active member
Hi guys, I'm having a frustrating issue with image file size limits.

I've been through permissions and left unlimited, ive checked with our server people and the php.ini permissions but still having problems :/

Tonight one of our users tried to upload an image and I noticed these errors logged in the backend of xenforo:

Server Error Log
Error Info ErrorException: Fatal Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 94720 bytes) - library/XenGallery/Helper/Image.php:615
Generated By: XXXXXX, 12 minutes ago
Stack Trace #0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}Request State array(3) {
["url"] => string(41) "https://freecannabis.com/media/save-media"
["_GET"] => array(0) {
}
["_POST"] => array(15) {
["type"] => string(5) "album"
["album_id"] => string(14) "20.testing pic"
["image_upload_type"] => string(6) "upload"
["image_upload"] => array(1) {
[234] => array(6) {
["media_title"] => string(33) "Clocktower_Panorama_20080622_20mb"
["media_description"] => string(0) ""
["tags"] => string(0) ""
["media_tag"] => string(0) ""
["media_embed_url_original"] => string(0) ""
["media_embed_url"] => string(0) ""
}
}
["media_image_upload"] => string(4) "true"
["media_"] => string(4) "true"
["image_upload_hash"] => string(32) "df5ca2ee05d512dfa7711d4c8ebb45b8"
["embed_url"] => string(0) ""
["container_type"] => string(5) "album"
["container_id"] => string(2) "20"
["_xfConfirm"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(22) "/media/add?album_id=20"
["_xfNoRedirect"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}


Delete...Close

Hopefully someone will know where I'm going wrong with this.

Thanks for your help guys!
 
Googling the file name, I assume it's this image: https://commons.wikimedia.org/wiki/File:Clocktower_Panorama_20080622_20mb.jpg More specifically, the original version, which is "23,680 × 2,144 pixels". This is approximately 50 megapixels.

To apply a watermark, this potentially requires quite a lot of memory as it needs to load the entire image (uncompressed) to work on it. Hence, you're hitting the PHP memory limit. It would require at least a temporary increase (from 256MB). That would certainly be a short term workaround.

However, there are a couple things I'm not sure about in this code, so I want to move this to bugs for further investigation.
 
Hey Mike, thanks for your response.

We increased the memory limit in the php.ini and that has sorted it for the moment but would be very interested to hear if there are any other issues.

Thanks
 
There was indeed an area of improvement here related to memory usage, which may (or may not) have avoided having to raise the memory limit. I'll send you a copy of the updated file if you wish to check that, but otherwise we'll consider this fixed for the next release.
 
Back
Top Bottom