Dynamically Resize WordPress Images On-the-Fly

Last updated on: September 8th, 2012

Creating multiple image sizes in WordPress is quite easy when the image is attached to a post or page. Theme.fm has an excellent write up on how to do this with the add_image_size function. The problem with this method is that it creates a lot of bloat because for every image uploaded it’s sized to this new size even if you’re not going to use it. Also getting the different available sizes from just a url is a pain.

To side step this issue Theme and Plugin developers have resorted to using scripts like TimThumb , which recently have a major vulnerability discovered. Another script that can generate images on the fly is called vt_resized. This script is nice because it uses native WordPress functions to generate the new image. The only is issue is that it does not support WordPress Multisite. Here’s a modified version of the script with crude multisite support.

If you find a bug let me know. Hopefully WordPress will provide a similar function in the WP core in the future.

About John Turner

John Turner is the founder of SeedProd. He’s an Entrepreneur, Web Developer, Marketer, SysAdmin, DBA, Support Tech and can even Cook.

1 Comment

  1. Santhej on February 25, 2013 at 8:37 pm

    while there is nothing wrong with the method you specified,beginners will find it a bit hard to implement it…i have written a post about resizeing wordpress images with a simple plugin..you can check it out here

    http://kalladamagz.com/resize-images-directly-in-visual-editor-in-wordpress/226/

Leave a Comment





LIMITED TIME OFFER - Get access to all of our plugins for use on unlimited sites for just $99  Learn More
[i]
[i]