ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

image resize feature in file upload not working properly

March 19, 2008 4:43pm

Subscribe [1]
  • #1 / Mar 19, 2008 4:43pm

    ventistudios

    56 posts

    This is my third EE installation/project and this is my first time with this issue.

    When using the upload file feature, the image resize is not working. I upload the file with no problems, but when I click on the resize button and set the desired size and click submit, my browser goes to a blank screen. Here’s the landing URL for that screen:

    http://example.com/system/index.php?S=1f7888be613f18a33b23815203c6e1ac94225405&C=publish&M=create_thumb&Z=1

    I have also tried to go back and insert the image after the blank page appears, but once inserted I can clearly see that the image has not been resized.

    I have tried making a copy of the image and also have tried replacing the image within the resize options. Neither work.

    I have doubled checked all my site file permissions and they are as they should be.

  • #2 / Mar 19, 2008 4:46pm

    Lisa Wess

    20502 posts

    Hi, ventistudios - first, linking directly to your control panel probably isnt’ the best idea, so I’m going to edit that.

    Second - what version and build of EE are you on, and what is your PHP Memory allocation? I suspect that it’s 8m, and you’re running out of memory with this image manipulation.

  • #3 / Mar 19, 2008 4:51pm

    ventistudios

    56 posts

    Thanks for editing the link. I was not thinking clearly.

    I am running ExpressionEngine v 1.6.2

    Do I modify the PHP allocation on my web server or within EE.

  • #4 / Mar 19, 2008 4:53pm

    Lisa Wess

    20502 posts

    A blank page is usually indicative of a PHP error - so this would be a PHP change.  One you’d need to talk to your host about.

    I am guessing, since the error is suppressed, but it’s pretty likely to be a memory issue.  You can check PHP Info (Admin -> Utilities -> PHP Info and look for “memory_limit”.  Also, while you’re there, look for display_errors, and let us know the value.

  • #5 / Mar 19, 2008 5:00pm

    ventistudios

    56 posts

    The memory limit is set to 8M.

    The display_error just has “on” in both columns.

    There is a display_startup_errors which is set to off.

    How do I adjust the memory?

  • #6 / Mar 19, 2008 5:02pm

    Lisa Wess

    20502 posts

    To adjust the memory, you’ll need to contact your host. They have to change it in the PHP environment. Can you check Admin -> System Preferences -> Output and Debugging and check that Error Debugging is set to show PHP errors to Superadmins?

    In any case, I’d definitely have your host up the memory, as it’ll almost certainly resolve this issue. If not, we can revisit it and get those errors to show, so we can troubleshoot further. =)

  • #7 / Mar 19, 2008 5:08pm

    ventistudios

    56 posts

    The error debugging is set to show PHP errors to super admin.

    I just found this on my hosts site, so I guess I will try the .htaccess solution:

    “If you are receiving errors while running a php script that look like:

    “Fatal error: Allowed memory size of 8388608 bytes exhausted”

    The problem is that the script was trying to use more memory than can be allocated to it. By default on shared servers any single php script can only consume 8Mb of memory, this is a hard limit set in the php.ini file and cannot be changed for stability reasons.

    Some customers have reported running into this problem when using scripts that dynamically resize large images into smaller versions. Low-loss image resizing is an extremely memory hungry process so running into this error is very likely. A work-around is to pre-process the images and store them in another location or cache; or you can call on another script written in a language that does not have this memory limit problem (like perl) to do the actual processing.

    You can also add an .htaccess file with the following command in it to increase the php_memory_limit:

    php_value memory_limit 16M”

  • #8 / Mar 19, 2008 5:10pm

    Lisa Wess

    20502 posts

    Give that a shot and let me know if it fixes things up for you, please?

  • #9 / Mar 19, 2008 5:26pm

    ventistudios

    56 posts

    Using the .htaccess file I was able to increase the memory, which allowed it to work. And for your reference I host with media temple.

    Now I also tried to upload different images and some gave me errors like this:

    “The uploaded file exceeds the maximum allowed size in your PHP configuration file”

    It still will upload and resize most images, but anything around 5M gives me the above error. Is the configuration file referenced a part of EE?

    I figured there is a limit somewhere. I think it will work fine for my client, but I am curious how far you could push the maximum size.

  • #10 / Mar 19, 2008 5:35pm

    Lisa Wess

    20502 posts

    Ah, yes, that you’ll need to update in Admin -> Weblog Administration -> File Upload Preferences.

    Just as a note, handling large files with PHP can be a bit difficult - there are things to consider such as browser timeouts, memory issues, processor use.  Any pre-processing you can do will help.  Just a note.  The larger the image, the more resources it takes.

    Does that get everything working for you?

  • #11 / Mar 19, 2008 5:36pm

    ventistudios

    56 posts

    You could not be more helpful. You’re awesome!

  • #12 / Mar 19, 2008 5:37pm

    Lisa Wess

    20502 posts

    Does that mean you’re all fixed up? =)

  • #13 / Mar 19, 2008 5:44pm

    ventistudios

    56 posts

    Yes, I meant that to come across as you were very, very helpful and I am good to go. Thank you again.

  • #14 / Mar 19, 2008 6:01pm

    Lisa Wess

    20502 posts

    Just wanted to make sure.  Glad you got it all working!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases