Joomla Tutorials and Blog Posts

Automatically Resize Images in Joomla

resizeMany Joomla users have faced the question of how to automatically create images of a standard size.

The SmartResizer plug-in is a great solution.

SmartResizer not only takes care of images in your articles, but can also create thumbnails for different layouts such as blogs.

The Example for This Tutorial

In the example below I've created a blog layout with no styling.

The original pictures here are between 800px and 300px wide. We're using the default category blog layout. As you can see, nothing fits and images overlap. It's a mess.

We'll add the plugin, then show you step-by-step how to improve the layout with automatic thumbnails.

tutuploadsFireShot_Screen_Capture__001Category_1A_Blog_Layout.png

Step 1: Install SmartResize

  • Download the plugin from the JED.
  • Open your Joomla Administrator area and go to Extensions > Extension Manager.
  • Upload the package file to install the plugin.
  • Go to Extensions > Plugin Manager and find the plugin. 
  • The plugin must be enabled. Be sure there is a green check circle under Status. If the image is red, click it and it will turn green.
  • Click the SmartResizer name to open the configuration controls.

Step 2. Configure the Basic Options

tutuploadsmedia_1334352118610.png
  1. Thumbnail width for blogs - thumbnail width for pictures in a category blog, section blog and front page.
  2. Thumbnail height for blogs - thumbnail height for pictures in a category blog, section blog and front page.
  3. Default thumbnail width for articles - default thumbnail width for pictures inside articles.
  4. Default thumbnail height for articles - default thumbnail height for pictures inside articles.
  5. Default thumbnail width for others - This is the default generated thumbnail width in px for images in other components (not com_content)
  6. Default thumbnail height for others - This is the default generated thumbnail height in px for images in other components (not com_content)

If you fill in values only for the width, the height will be automatically calculated. If you put in values for both width and height, the image will get cropped.

Parameters 1 and 2 set fixed dimensions for the thumbnails to be displayed in category blog, section blog and in the front page. Parameters 3 and 4 set default thumbnail dimensions for the article view. Each picture can be assigned its own thumbnail dimensions inside its article by defining properties height and width in IMG tag in the editor. If neither height nor width are given, the thumbnail size will be determined by default parameters 3 and 4.

I set all the widths to 200px and left the height blank.

Step 3: Category Thumbnails Automatically Generated

tutuploadsafterupload.png

You can see the difference. Now all the pictures are resized, but they have no styling. Let's give them some style.

Step 4. Configure the Advanced Parameters

tutuploadsmedia_1334353759663.png
  1. Create thumbnails for all images - If No then create thumbnails for images with 'smartresize' command only, if Yes then create thumbnails for all images except images with 'nosmartresize' command.
  2. Ignore individual image size - If Yes then ignore individual image size in IMG tag and apply a default thumbnail size for articles and other components except images with 'smartresizeindividual' command.
  3. Create link to article in blogs - if Yes, in blog view, create a link for the thumbnail pointing to the article.
  4. Image style for blog - you can set thumbnail decoration in blogs and homepage with this parameter. An example of the parameter value: background-color:#EEEEEE; border:1px solid #999999; padding: 3px;margin-right:5px
  5. Image style for article - you can set thumbnail decoration in article with this parameter.
  6. Image style for other content - you can set thumbnail decoration in other component content (not com_content) with this parameter.
  7. Full image display style:- New window or RokBox - full image opens in a new browser window or in the lightbox if RokBox system plug-in install - Pop-up window - full image opens in a pop-up window.
  8. Store thumbnail in - the same folder as original image or in cache folder.
  9. Thumbnail Extension - sets a suffix for the file name of the thumbnail.
  10. Thumbnail quality in % - Sets the thumbnail image quality.

Step 5. Add style to blog layout

tutuploadsmedia_1334600361909.png
  • Return to the Extensions >Plugin Manager > Content-SmartResizer.
  • Open it for editing by clicking the name, or check the box and click the Edit icon.
  • Go to the Advanced tab.
  • Type or paste your styling into "Image style for blog".
  • Save.
  • View your blog layout.
  • Below is a copy of what I used.
padding: 5px 5px 5px 5px;
margin:10px 10px 10px 10px;
border:1px solid #CCCCCC;
background:#EEEEEE;
float:left;

Step 6: The fully styled blog page

tutuploadsstyling_the_blog.png

All the pictures are now uniformly styled with a "picture frame" and aligned the same with the same spacing.

Repeat the process for the article and other content thumbnails. This will get you started. There are several other features that will make handling thumbnails more automated and your design more uniform. This integrates with RokBox from RocketTheme. If you install RokBox , the full-size picture in article will open in a lightbox, instead of a new browser window. You can download RokBox from RocketTheme.com.

 

Comments

 
Paulo Griiettner
#1 Paulo Griiettner 2012-04-18 17:24

WOW... nice... I never heard about this plugin.. I'll definitelly give a try... Thanks for sharing this tutorial...
 
 
HarryBSee
#2 HarryBSee 2012-04-19 01:11

Ed, have you used this plugin with J2.5? I went to the site and it seemed to indicate it hadn't been updated yet, but no definitive answer on that or a timeline.

Thanks.
 
 
Paul Webster
#3 Paul Webster 2012-04-24 02:39

Great article about this plugin as well as how to use it in various ways. I wondered how you could wrap text around an image in Joomla and now I know :)
I just hope it will work with Joomla 2.5.
 
 
George
#4 George 2012-04-24 09:04

Nice tutorial...but does it work with the new "images and links" field in J2.5, where the image is not formatted within the content editor?
 
 
mamo
#5 mamo 2012-04-26 11:36

is that work with joomla 2.5 ? if not what we must to do ?
 
 
edandrea
#6 edandrea 2012-04-27 18:07

For the people asking about this working in 2.5. This tutorial was written using 2.5. The example screen shots are all 2.5.

Ed
 
 
George
#7 George 2012-04-28 07:40

The compatibility with J2.5 has been verified, but the question regarding the proper function of that plugin when "images and links" fields is used to insert the image instead of a content editor, has not been answered...

Sadly I am getting errors with this plugin in pages with unpublished articles that carry images...i.e. if you're registered with the proper group and can see unpublished articles in the fronted, lots of errors display...

I had been using mavik thumbnails and I hadn't ever got this error. Not absolutely certain, but pages feel just at tad heavier with SmartResizer compared to mavik thumbs, like it takes a little more to get the job done.

Could you recommend any other plugin with similar capabilities?
I have found BK Multithumb to be the most versatile, but it has lots of small bugs...
 
 
fuzzysideup
#8 fuzzysideup 2012-09-02 15:59

Installed plugin and configured it. It seems to work but I get this error displayed at the top of the page.
Warning: getimagesize(im ages/1st%20alzh eimers%20walk.j pg) [function.getim agesize]: failed to open stream: No such file or directory in /home/wecareho/ public_html/plu gins/content/sm artresizer/smar tresizer.php on line 336
 
 
Guest
#9 Guest 2012-10-21 14:00

Hello. I found out about this extension in the Joomla Forums. I'm very interested in trying it, but the link to it is broken. Can you guys repost the new URL at the Joomla.org's Extension Index?
 
 
cferreira
#10 cferreira 2012-11-18 22:45

Hi
The developer site:
www.lot-studio.ru/.../
 
 
Michael Rader
#11 Michael Rader 2013-02-11 18:24

My website contains tons of images. One image (of one large size) can be used throughout the site in three different sizes, all currently resized using CSS. Instead of using CSS I want a plugin that creates the two other different sizes automatically when I upload the one largest version. Will this plugin do that?
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,142 training sessions in Joomla, Drupal, WordPress and Coding.

Manage All Your Joomla Sites

adminicredible

With Admincredible you can update and manage all your Joomla sites. If you have 5 or 500 sites, Admincredible will make your life easier! Visit Admincredible.com.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.