Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im searching for some clue about this behavior? I think it is a PHP memory_limit or WP define('WP_MEMORY_LIMIT', 'X') issue?

Sometimes images are resized and sometimes not, in other scenarios the browser crash:

  1. Im using Dreamhost as shared hosting, and their 7 upload limit.

  2. Error printed with an uploaded image of 6.4MB of size and with a width and height of: 11684x3855: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 46736 bytes) in /PATH/wp-includes/media.php on line 254

  3. Other users reports the same issue with files, for example, of 3MB but with higher width and height (superior to 2000px or 3000px).

Any help is welcome.

Thanks in advance.

share|improve this question
    
Please explain what you mean by "not working well". –  scribu May 18 '11 at 3:42
    
Sometimes images are resized and sometimes not. –  José Pablo Orozco Marín May 18 '11 at 18:31
    
You'll need to explain your problem better. What happens when images are not resized? You get an error? It saves ok but the images are not generated? –  MZAweb May 18 '11 at 19:33
    
I recommend taking a look at this article. It'll help you explain your question in a way that prompts other users to answer. blog.superuser.com/2011/05/02/how-to-get-answers –  Zach Shallbetter May 18 '11 at 19:34
    
Thanks for your guidelines, honestly I know all those things, but this time I get what I diserve for been a lazy moron. I just update my question. Besos. –  José Pablo Orozco Marín May 18 '11 at 20:58

2 Answers 2

up vote 4 down vote accepted

I've had the same issue in the past when uploading very large images. When it comes to crunching the image it fails and shows HTTP ERROR in red. However other images continue to load. It wasnt file size where it would fail but rather the pixel width and height of the images.

By default PHP settings, the most GD libary can handle per image is 1,000,000 pixels which is 1024px*1024px

Did you know: 8,000 pixels times 8,000 pixels times four bytes for truecolor equals a walloping 256 megabytes. Now I know no shared hosting webhost that allows you a PHP memory limit of 256MB

The only solution I was able to find, of which I'm offering to you, is to reduce the size of the images beging uploaded. Alternativly convince your webhost to up PHP memory limit, which is unlikely.

share|improve this answer
    
Thanks. A question, there exists some WP constant or hook to decrease upload limit? This is what tried in .htaccess: php_value upload_max_filesize 4M php_value post_max_size 5M php_value memory_limit 90M But the upload limit continues in: 7MB. –  José Pablo Orozco Marín May 19 '11 at 18:03

As @Brady said alot of settings go only to 1024 x 1024 this will probably change in the future as stats for resolutions, browsers, Internet speeds, etc change and show that alot of people are running better or newer systems

reduce the image size as most users do not need to view a image that is bigger then 1024 x 1024. I usually use the 800 x 600 or bigger but less then 1024 x 1024. Most of my images though are smaller

share|improve this answer
    
runnnig the image through smush.it first wont help in this instance. When GD opens the image it opens it in memory like a bitmap image. Each pixel has its own RGBA so each pixel takes up roughly 3-4bytes of data. You can optimize the image all you want it wont help when you come to proccess it. –  Brady May 19 '11 at 6:52
    
True i forgot about that –  xLRDxREVENGEx May 19 '11 at 6:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.