Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

image size problems WordPress

  • SOLVED

I'm trying to create a photoblog site.

Using autofocus pro theme.

I upload the pictures I want in a gallery, create a gallery, and post. But the only image size selections it gives me is Full Size. I cannot select thumbnail, small or medium. My images are huge.

I got this site many months ago, when I made a gallery a couple months ago, everything worked fine. Create nice gallery with thumbnail images. Now I'm back, working on the site and nothing is working as far as image sizes go.

Please help.

Answers (2)

2010-07-18

Lew Ayotte answers:

What host are you on?

It sounds like WP isn't auto resizing the images automatically. This is usually because the site is using too much memory w/ PHP when it tries to do the resize.

Hosts like, 1and1 limit the memory to 32MB which can be consumed a lot when processing really large images.

You can try editing your .htaccess file (located in the root directory of your WP installation) and add this line:

php_value memory_limit 64MB

And try again... but again hosts like 1and1 disable that command, so you're stuck with their default setting.

If that doesn't work, you'll probably need to resize the image to something smaller before uploading. If you need people to be able to download the full-res version, you'll have to upload both, the small and large versions.

Hope this helps.

Lew


ROOOOTS comments:

I'm using hostgator.

When I upload pictures with the flash uploader I get this response.

Fatal error: Out of memory (allocated 69730304) (tried to allocate 17152 bytes) in /home/rootsone/public_html/wp-includes/media.php on line 253

So what your saying seems to make sense. I'll try resizing. But when things worked fine couple months ago I never had this problem and was uploading same image sizes. What gives.

I'm computer savy compared to the average citizen, but this web stuff is all new to me.


Lew Ayotte comments:

Yep, that error sounds like the problem I described.

hostgator may have changed their default memory limit... not really sure... also have you installed any new plugins or upgraded Wordpress since your last time?

The newest WordPress uses slightly more memory and any new/upgraded plugins could be consuming some memory as well. So if you had upgraded or installed anything new, it might explain why it no longer works.


ROOOOTS comments:

The pictures I am trying to upload are all generally under 10mb.


ROOOOTS comments:

Yes, I have installed some plugins, lightbox type of things, and wptouch iphone theme.

I upgraded to wordpress 3.0, but this problem was occuring before 3.0 as well.


Lew Ayotte comments:

The PHP value "memory_limit" is not really about the size of something being uploaded, it's the amount of memory being used to process the PHP. So a 10MB picture being resized could take up 70MB of RAM. It looks like from that error hostgator gave you, the memory_limit is set to around 64MB and you went about .012MB over that limit which caused it to fail. You could probably save that particular image at slight lower resolution and have no problem uploading it to the site.

2010-07-18

Tiago Duarte answers:

Try the following:

- open wp-admin / includes / image.php
- find the following lines:

// Set artificially high because GD uses uncompressed images in memory
@ini_set('memory_limit', '256M');
$image = imagecreatefromstring( file_get_contents( $file ) );


Change 256M to any higher value, yet do not put it too high.
(Note there is a M after the 256, that's important)

Also, some friends of my own have experienced this aswell, and they ended up finding their problem was Host-related, so they called the support and it was fixed.

Hope it helps,

Tiago