Image Resize

This slick plugin takes care of the need for resized thumbnails in articles without the need for a complicated thumbnail component.  If you want to put a thumbnail size image in an article but keep the full size available on the server, this is for you.  Details below.

Written by Daniel Beck

To give credit where it is due, I am not the author of this plugin.  It was written by my friend Daniel Beck; the most I did was provide a few ideas for its implementation.  Now I host it for him and will field any bug reports and feature requests.

Current Version: .5

Version .5 of the image resize plugin is available from http://joomlacode.org/gf/project/imageresize/frs/.

There is a feature request and bug tracker open at http://joomlacode.org/gf/project/imageresize/tracker/.

Usage:

This plugin is completely transparent to the user.  (That’s the beauty of it.)  Simply upload the image using Joomla!’s normal image upload function.  Then grab the image and drag it to resize, or use the dialog box to specify a width for the image.

When an article is accessed, the image resize plugin will find all the images in the article and resize them per the defined “width” attribute, caching the resized version.  If there is no width attribute it will leave the image at its normal size.  It only does this resizing the first time the image is accessed at any given width; after that it pulls the image from the already cached version.  Then the plugin replaces the src attribute on the image tag with the URL for the resized version.  Thus the user never sees the plugin, and the URLs still point straight to images instead of passing a size as a parameter, which could be a security flaw.

So whenever you access the article from the front-end, any image will be scaled to exactly the size specified in the width attribute.  When you access the article in the editor it still pulls the original image, not the resized version, so you can easily change the image’s size.

One thing to note: if you set the image width larger than the original width of the image it will, of course, become fuzzy.

Installation:

  1. Make sure you have Imagemagick on your server
  2. Install the plugin
  3. Go to your Plugin Manager and enable the plugin
  4. That’s it, you’re done!

12 Comments to Image Resize

AzzX
14 August 2008

Slick is an understatement.

I really loved the auto thumbnail ability of Wordpress and not having it with joomla seemed very short-sighted.

Great work lads!

Ugur Uygur
14 August 2008

Thank you

Eric
14 August 2008

Great, but dear author use the right joomla name.

not
image_resize_.5.zip

but
plg_image_resize_v5.zip

Joe
14 August 2008

Just Tested it, works very well :), although Simple Image Gallery and Image Resize cannot be used in the same page. Looks like am gonna be using it in any case, thank you very much :)

Bert Schipperijn
15 August 2008

Now that sounds like a great tool. So some clients we have, that can not work with adobe or does not understand resizing tool at JCE pro,can now easely resize at Joomla editor. Could be just the thing we needed. We are going to test and use it!

Thanks!!

Sunny
16 August 2008

I received an error stating that there was no XML file to read. The XML file is clearly there in the zipped folder. Joomla 1.5.

Any help? Thanks.

Jonah Dempcy
18 August 2008

Anyone know if there is a plugin that will show thumbnails of images when inside the ‘intro text’ preview, but full images on the article page?

Or should I just put two copies of the image in the article, one small one in the intro and a large one below the “Read more…” cut off? Then I have to hide the intro text on article pages, but that may be easier … Thoughts?

Sorry if this is a noob-ish question, just learning Joomla.

Thanks!

Jonah Dempcy
18 August 2008

I’m getting the following error on a Dreamhost Joomla install:

Warning: mkdir() expects at most 2 parameters, 3 given in [path omitted -J]/plugins/content/imageresize.php on line 52

Jim
18 August 2008

@Jonah: Perfectly fine question, I’ve come up against the same problem myself. My answer was what you decided upon, putting the image in twice. I’m sure you could write a plugin that finds the first image tag, resizes it to a set size, and places that in the article. It just feels like there would be a lot of potential problems with that.

As far as mkdir(), what version of PHP are you running, and with what server stack? Feel free to email me and we can work on it.

Jeroen
4 September 2008

Thanks, this is just the resize extension which does nothing less or more than I need. Very simple installation and usage.

Hans Peeters
11 December 2008

Is there a way to let this wonderfull little gem run as a other user then the apache user, im getting trouble that the directories created in the cache folder have the wrong permissions

James
11 December 2008

@Hans: I think that will be less a problem of this particular module as what user you have PHP running under. I’ll try to look into it sometime.

Leave a comment