Plugin: Resize at Upload v1.0

* Breaking News *
I have no plans of further developing this plugin since the plugin Scissors has that ability too, and much more.

A new version of the plugin Resize at Upload is available now. Who doesn’t know what the plugin can do, please read below the following.

The plugin is using a class which will handle the actual resizing. Since GD2 is better in resizing, I’ve replaced the used GD function with a GD2 function. This tip I got from Rafael. If you don’t have GD2, it will use the GD function. That is the only change from v0.9 to v1.0.

What is the plugin Resize at Upload?
I’ve read many requests for a plugin to resize uploaded images because the images commonly destroy the theme when publised with the original dimensions (like photos straight from digital cameras). I was looking around for some plugin like this one too. Because I couldn’t find any, I decided to write one myself.

You can download the plugin here: http://wordpress.org/extend/plugins/resize-at-upload/

As you can see above, there are two settings. One setting is if you want to resize. Set this one to “no” if you don’t want to resize (you don’t have to deactivate the plugin in this case). Maybe in a later version I will include a selection option in the upload area to activate/deactivate resizing.

The other option is the max width. In my theme I use images of 672px width. So I changed this field into 672 and every image (JPG, GIF or PNG) will be resized when it is uploaded.

Keep in mind, there is no backup or original file kept with the original sizes. The file you have uploaded, is resized. Also EXIF information is lost.

The plugin requires PHP4 (at least) and GD, preferably GD2, and is tested up to WordPress 2.7. There is no problem to use the multiple upload option, each uploaded image is resized.

Keep in mind that WordPress will show images width max 500px if there is no variable set like:

$GLOBALS['content_width'] = 650;

Maybe in future versions of WordPress this will change but till now you have to put this somewhere inside your theme. This plugin will not change that nor help you with this. That’s your problem to solve in your theme 8-)

Wishlist:
1. Resize in Height as well
2. Keep EXIF information

Contributions/stolen code ;-)

For this plugin I use a class from Jacob Wyke (www.redvodkajelly.com) and parts of the plugin Upload+ from Paolo Tresso / Pixline (http://pixline.net).

About the Author

Na een jarenlange ervaring in programmeren en webdesign wordt deze blog gevuld met artikelen die gerelateerd zijn aan internet. Daarnaast bij vlagen een column of een mooie foto.