Thursday, October 11, 2012

Wordpress Image Scaling Incorrect

I just noticed that Wordpress is not resizing images correctly: It would appear correct in the blog itself, but the IMG SRC tag would link to the original, unscaled image: This meant that the image was downloaded at the maximum size and scaled on the client side. I never really noticed this because modern PC's - even my outdated one - have enough processing power to just do it on the fly and browsers use quality scaling filters that smooth out the pictures.

Still, it makes the site unnecessarily slow. After some investigation, I found out that it looks like Wordpress uses 32MB of memory by default - and that's really not much.

Editing your wp-config.php file, you can add the line:

define('WP_MEMORY_LIMIT', '96M');

to increase the limit. I decided on 96MB for a start, but maybe 64MB will be enough for you - I'll leave that to you.

Anyway, now Wordpress scales images I upload correctly. It won't fix older images, but I can live with the big pictures in my archives.