Looks like image resize is not working well

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: 11684×3855:
    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.

2 Answers
2

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.

Leave a Comment