|

Timthumb Convert Graphics To Web Thumbnails

Timthumb is a script used in many WordPress themes for converting graphics to web thumbnails, errors in the script caused the creation of huge png thumbnails.

Timthumb.php uses the GD graphics library in PHP  in order to create thumbnails from your uploaded images, these images are then cached for later use. The problem is that for quite some time users have been experiencing errors with this script, errors that in some cases resulted in png thumbnail files being created that were as much as 6 times bigger than the original jpg files that were uploaded.

 

As an example please check the properties of the images above & below 

Timthumb Convert Graphics To Web Thumbnails

The top image is 14.3kb which is more or less the size of the original image, saved on my laptop.

However the timthumb.php thumbnail script would for some obscure reason, convert any uploaded images to png format as in the case of the image to the left. This resulted in an image of 99.3kb which is 6.9 times bigger than is actually required.

As you can imagine this has been disasterous for site load times as even small web thumbnails of around 2.5kb would end up being converted to png graphics of around 15kb.

 

 

The Solution To This Problem

 

 

Luckily after much searching, trawling the net & asking questions on various forums I was eventually pointed in the right direction by none other than one of the staff at my hosting company Web.com.php (Thanks again guys)

There is an updated version of the Timthumb script available to download here Timthumb.php

After completion of the download, please remember to take a complete backup of your database before proceeding any further.

Now extract the file and then upload to “wp-contents/themes/your theme/includes/timthumb.php” overwriting the original file, then whilst still using your FTP client, open the folder called cache & delete all files that are there, this will force fresh copies to be taken with the new script. That is all you need do & hopefully your timthumb.php script will now convert graphics correctly to produce your web thumbnails.


No related posts.

Posted by on May 26 2010. Filed under Hacks & Mods. You can follow any responses to this entry through the RSS 2.0. You can leave a response or trackback to this entry

8 Comments for “Timthumb Convert Graphics To Web Thumbnails”

  1. Thanks… this is an awesome script.

  2. Lisa if I knew exactly what they had changed in the code, then I would have written the plugin myself ;-)

    However if it important to you to know exactly what they have done in all the updates released for this plugin, then please checkout the following link: http://code.google.com/p/timthumb/source/list

  3. So what did they update? I want to use it but it seems like a old ver 1.08 of timthumb.

    Exaclty what did they change in the code?

  4. AWESOME SOLUTION! Thank you so very much. Simple, easy, straight forward instructions. Highly recommend this!

  5. Good, guys.
    It is needed, exactly.
    Thanks you.

  6. Vary good solution.
    I’ll try it so much.
    Yep, thanks.

  7. Hi Fredrik,

    Nice when it finally works as it should eh…?

    Worked great for me also hahaha ;-)

  8. Wow!

    It worked perfect! It took half a second off my sites loading time and this “tweak” only took about one minute to make.

    Good stuff!

    Thanks.

Leave a Reply

*


Advertise Here:

More From This Category

Sponsored Ads

Business WordPress Themes Scribe. SEO Made Simple.
Catalyst Theme - WordPress Accelerated
How smart is your Theme?  How good is your support? Check out ThesisTheme for WordPress.
No Need For WordPress Developers — Drag & Drop With Headway link building
Sell Your Website - WebsiteBroker.com
Guaranteed Top 10 Exposure Across 350+ Search Engines