Fatal Error when uploading JPEG-File

9 years 1 month ago #262346 by erichburkhard
Fatal Error when uploading JPEG-File was created by erichburkhard
Hi - I have installed CB 2.0.7 / Joomla 3.4.1 / the newest Version of the CB Gallery plugin. In the CB Gallery I have the following settings:







Then I go to the frontend and try to upload a JPEG file (size: 2.04 MB) ...the following error message appears (before I swichted the Website into 'debug' mode):

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 31961089 bytes)
in /home/www/web180/html/joomla/pre_production/libraries/CBLib/Imagine/Gd/Image.php on line 622

...if I try to upload a really small file (approx 1 MB) the upload works...any idea whats wrong here ?

regards
Attachments:

Please Log in to join the conversation.

9 years 1 month ago #262356 by nant
Replied by nant on topic Fatal Error when uploading JPEG-File
The upload resampling is using up all your PHP memory.

Your options:

1. don't allow such imgae file uploads
2. increase your php memory
3. turn off resampling (security implications here)

Please Log in to join the conversation.

9 years 1 month ago #262364 by erichburkhard
Replied by erichburkhard on topic Fatal Error when uploading JPEG-File
I don't exactly understand what you mean: under CB 1.9.1 I was able to upload a file of 2 MB....no problem...then I upgraded to CB 2.0.7 and now this error appears because this 2 MB file is too large ? I didn't change anything on my PHP-memory settings (I even don't know how to do it) ....

Please Log in to join the conversation.

9 years 1 month ago - 9 years 1 month ago #262391 by krileon
Replied by krileon on topic Fatal Error when uploading JPEG-File
The image file you are uploading is too big for PHP to process with your current memory limits. Exploding an image into raw data then processing it massively increases its size. Basically your 2 MB file turns into 30 MBs of memory when this happens. Specifically the memory issue is happening from imagefill PHP function.

Also note this isn't specifically a file size issues. It's pixel data that's the problem. The higher the dimensions of the image the more pixel data it needs to store in memory to process the image. So if you've like a 2000x2000 that's a ton of pixel data and when exploded will take something like 40mb or more to process.

Normally this shouldn't be an issue, but the combined memory usage of your install is lilely not leaving much for image processing. For example if you've 100mb or 128mb being used then there's barely any memory available for other processes. You can try using PHP.ini to increase your memory limit to something like 256mb and see if that'll help. You may also want to consider switching to ImageMagick if your host allows it as GD is known for being extremely heavy on memory.

If you need a quick way to judge an images memory size you can use Gimp. Open the image then under Image > Image Properties you'll see in the window that pops up "Size in memory". Just as an example my 1920x1200 image that's 461kbs in size takes up 22mb of memory as raw data.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

9 years 1 month ago - 9 years 1 month ago #262623 by erichburkhard
Replied by erichburkhard on topic Fatal Error when uploading JPEG-File
Hi Kyle i have read your feedback but there is still some behaviour I can't explain. At the same hoster I have set up 2 environments:

environment 1: Joomla 3.3.6 / CB 1.9.1 / PHP 5.5
In the CB the settings for the portrait upload are as follows:



in the frontend I have no problem to upload the example file of 4.2 MB


enwironment 2:
To create this environment I took environment 1 (as an baseline) and upgraded to Joomla 3.4.1 and CB 2.0.7. (this environment is on the same hoster as environment 1) that means also same php.ihi file and also other Settings are identical.




if I try to upoad the example file of 4.2 MB as a new portrait I get the exceptions as described in earlier postings

...so if this is true that I do not have enough PHP-Memory, why is it possible to upload the same file in environment 1 ?
...and why is it not possible to change to ImageClick? (In environment 1 I can choose ImageClick in the dropdown, in environment 2 the dropdown shos only the GD-Option ...as I said both Environments are on the same hoster)

regards Eric
Attachments:

Please Log in to join the conversation.

9 years 4 weeks ago #262700 by krileon
Replied by krileon on topic Fatal Error when uploading JPEG-File
We've completely replaced our image processing library in CB 2.x. Both the new library and CB it self have a higher memory demand than CB 1.x. So immediately you will already have lower memory available due to this. The new image library is more accurate with its processing and as a result more heavy.

You will need to increase your memory limits or ensure ImageMagick (takes less memory than GD) is properly setup. For ImageMagick it needs to be correctly loaded, its Imagick class available, and it needs to be at least version 6.2.9.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.224 seconds

Facebook Twitter LinkedIn