77 thoughts on “A Brief History of TimThumb Leave a comment

  1. Awesome, Ben! I recently released 5 WordPress themes over at ThemeForest, and every one of them (now) uses TimThumb for dynamic image resizing. The only reason I had gone with Smart Image Resizer for the first 2, was that I needed to have a variable height on some images. TimThumb requires a width and height, while Smart Image Resizer doesn’t. But man, the headaches that script caused! Nearly every support request I endured was due to Smart Image Resizer compability issues. Not a single one since switching to TimThumb.

    Anyway, I’d love to beta test the next version. I use transparent PNGs on my own blog and have been manually resizing them for smaller versions.

  2. Thanks guys – I shall send over the new versions in a second πŸ™‚

    Matt – Not sure which TimThumb you’re using but there is a version that supports just supplying one dimension (the version I will send you works for sure) so maybe you can switch πŸ™‚

    Kel – thanks for the suggestions. As I mentioned about the percentage scale one “should” work. The focal point would be handy if you know what you’re doing but I am not sure how useful it would be when making themes as you have no idea how people will use the image…

  3. Two Feature Suggestions:

    * Focal Point – TT crops from the center – would love to see a feature for a user specified point of interest. Even something simple like Left, Center or Right would be better than just center. It’d be nicer still to define nine regions (TL, TC, TR, L, M, R, BL, BM, BR)

    * Percentage Scale: Currently TT asks for a defined width or height. I want the height at 100% while using a width defined in pixels – this stops the image from cropping. (I currently use “0” to fool TT into using 100% for W or H)

  4. Very impressive mate, I’m gonna try and use this in the sports site I’m developing. Nice one!

  5. Excellent work on the script. I would like to beta test the new version and am particularly interested in being able to use external off domain images for several shopping sites I am developing.

    1. Hi Shandy and Kevin – thanks for the offer of help. I am at work now but will make a note to send you the latest version when I get home.

  6. “The future” as you put it, looks pretty awesome!

    Eager to test the new version of TimThumb when you get a chance.

  7. I am trying to create a Word Press site where I can market my fine art prnts. The thumbnails are the problem as I don’t know if I can get TomThumb to resize the entire image of each print. I can’t cut the image in the thumbnail. I need thumbnails that vary in size as my prints do. Can this be done with TomThumb? It would be very helpful to the thousands of artist out here who want to manage their own sites (WordPress) and present the entire image in the thumbnail. Help!

  8. Hi Ben,
    I’m doing some more work at the moment on a project and I have a testing site on a subdomain. The paths to the images are all on the same subdomain but timthumb wont show the images. I’ve never used it on a site with a subdomain before and ws wondering if this comes under the same category as a different domain? Presumably that will be resolved by the same code as the cross domain fix?


  9. I’ve used and am using phpthumb/timthumb for several (WP) sites.

    And I am very curious about the cross-domain feature. Please mail me copy of the beta version, I will try it out since I’m in the middle of testing anyway…

    Good luck with it.

      1. I’ll have to have a look at your changes. TimThumb does actually work across domain now. The reason I block it is for security rather than ease of use.If you allow files from any domain it will be a lot easier to load a php file onto someone elses website.

      2. I do agree with the security issues, I have used it on a few projects, in conjunction with my WPMU alterations to the file.

        These are definitely hacked, but oh well πŸ˜‰

  10. Ben,
    Thanks I’m excited to try it out. As of today I have not received your e-mail with the latest code.

  11. I’m going to be writing a new post with a download link and an explanation of how to set it up. Hopefully that will make things a bit easier for everyone πŸ™‚

  12. Pingback: Amazed this blog is still getting visitors « binarymoon
  13. I would love to test the new version as well… I will check back later for the download link. Thanks for all your hard work on this!

  14. Pingback: TimThumb beta test » Binary Moon » The home of Ben Gillbanks
  15. The post is up and online so you can now get the latest TimThumb beta without having to wait for me to sort things out πŸ™‚ Full info here

  16. Works great. I had no problems getting the cross domain stuff to work and in fact for the purpose I am using it I can actually disable the domain checking with confidence. Great work Ben

  17. I have encountered my first problem using Tim Thumb. I’m sure it’s nothing to do with the code but rather the server it’s running on but I thought I could ask and see if anyone know’s a reason. For some reason, although the temp/cache folder is writable the images are created in it with 0 bytes. The file is there but it has no data. I’m stumped. Anyone know a reason why that might be. Oh, the images in question are from external domain.


  18. Hi Ben

    TimThumb and WPMU compatibility – And now for something completely different!

    I’m sure I speak for many WPMU OP’s when I say this – we have TRAWLED the INTERNET, in search of the final answer to compatibility between TimThumb and WordPess MU (blog directories and cache permissions etc.. etc.. etc..).

    Now that you’ve taken on this much required, requested and popular varmint of a script, can you please implement your fine knowledge to solve this if not controversial issue because there are more and MORE WP and WPMU theme designers implementing this script – it’s becoming a necessity!

    Now then, personally, I would go as far as to offer YOU “no one else” no more than (three sheep AND one fine young goat) in return for getting this predicament finalized and sorted – yes, as you’ve ascertained quite rightly, I’m a farmer and I reside in Kurzukstan.

    Would you be interested in this offer – seriously!

    If so, contact me immediately, and I will arrange for my sister, who is also “available for extra or intra marital relations” to contact you in due course with delivery of these fine specimens wherever you request – BTW: anything goes, say no more – mum’s the word!.

    Thank you – honorably awaiting your reply πŸ™‚

    1. Hi

      Thanks for your very kind offer but I am more interested in camels. If you had a couple of those then we might have a deal?

      What I really need though is ftp access to a website using a WPMU install that doesn’t work. I have tried asking for it before but nobody wants to share. I have installed WPMU myself and TimThumb worked fine so I need to be able to see it not working and modify the code on the server so I can test it fully. I want it to work but at the moment am having a hard time getting a method for testing it. If you can help me with the testing then you can send the login details via my contact page (http://www.binarymoon.co.uk/contact/)


  19. Aaaa, Camels.. Alas, I’m afraid sir that this is an area I can not deal in. Although, one of my sisters “Umfoofoo” does have a surprising likeness to the beast. Below is a picture of her, don’t be afraid on first view, as they say, beauty is in the eye of the beholder..

    My sister Umfoofoo is on the left of the picture, she is hanging out with one of her girlfriends.

    I will contact you in due course..

    Borris πŸ™‚

  20. Hi there Ben…

    Just a quick question… I’d like to implement TimThumb on my site. However, the site has been up and running for years now, and I have loads of images I’d like to keep… so is there a way to change the path to images in TimThumb so that the data in the Image field doesn have to be for example wordpress/uploads/images/image.jpg but just image.jpg?

    Tnx in advance…


    1. Hi – there’s no reason you can’t modify TimThumb to adjust the image path to point wherever you like. A lot of it depends where you want to place the TimThumb script. If you placed TimThumb in the image directory you could simlpy pass the filename as the source (make sure to include the cache directory as well)

  21. Hey Ben,

    I know I’m a bit late to the party, but I would love to beta test these very much asked for additions on behalf of all WooThemes members πŸ™‚

  22. I am having the same issue with WPMU and Tim Thumb… In my case, I have the lastest version of Mimbo Pro installed as the theme for the front blog installation of WPMU… I would be happy to help… as I can’t definitively solve my problem. Has anyone found a solution to this yet.. I would love to figure it out..

  23. If you are still looking for a wordpress-mu server setup to test your scripts on I am more than willing to provide a site and access.

    I have probably collected a few dozen themes that use timthumb, and not one of them works in an mu environment. It all comes down to the server paths due to rewrite issues.

    Simply send me an email letting me know your interested, and I’ll respond within 24 hours.

    It would be HUGE to finally have this problem resolved once and for all.

    Sorry, no sheep, camels, or sisters to offer, just a couple of seriously lazy cats

  24. Hello
    Thank you for your very useful script
    I am very interested in having the link in order to resizing remote images

  25. Hi Ben,

    Thanks for the nice script! I’ve just recently used this script. I’ve no idea that this timthumb script just recently developed as os and still on beta.

    I’m using timthumb script for my wp theme development but having trouble with image catching from attachment url using :
    src=ID); ?>

    Other than the attachment, everything seems fine. If i’m using it on my machine (using easyPhp) everything is alright but not on my domain. and this problem is only when using that specific attachment function mentioned.

    Thanks for help.

    1. seems like having trouble viewing the php code.

      src=[php open] echo wp_get_attachment_url($post->ID); [php close]

      i hope this turn out ok.

  26. I can say this is a really great script. Thank you very much!

    The only problem I’ve encountered is when trying to move my blog from a domain to another. The thumbs aren’t simply displayed. I have had the same problem when uploading files from the BlackBerry for WordPress App. What can I do to avoid this issue? Thanks!

  27. Pingback: Be Water My Friend… With Thematic
  28. Is it will be good if you can tweak this code to prefer future problem such as readfile problem and enable to use crop parameter, such as I need to crop the image from the top left, or some times we need to crop from the center of images.

  29. Pingback: The History Of TimThumb
  30. I would be really interested in testing the beta of TimThumb with flickr. I am using a theme that uses timthumb but none of my pictures will show up because all of my posts are done using flickr. Would love to hear from you!

    1. Hi – the beta is no longer a beta. I would grab the latest version from Google code as that is the most up to date.

  31. Thanks for the reply. I downloaded the file, deleted the current text and then copied and pasted it into my timthumb.php file on my theme editor (Platformate)

    I don’t know if I am doing the right thing as I am a complete novice.

    Anyway after I did that I enabled Timthumb and the result was exactly the same as it was with the old code. The flickr pictures come up as red x’s in the place of the thumbnail. The one picture that is uploaded onto wordpress as opposed to flickr does show up, same as with the old code.

    For now I have disabled timthumb as the red x’s can be quite unsighly as you can imagine.

    Please please please if anyone can help me out here I would be eternally grateful!

    Thanks in advance!

  32. I like the script but I have old version. Is it possible to download latest version from some site but no from SVN. I would not like to install subversion client just for once. Thank you.

  33. Then what do u do after u have the code? Do you paste it into the timthumb folder with the other code or replace it? Or put it in a file in the cpanel… Excuse the ignorance I’m new to all this web stuff!

    1. You should replace the contents of the existing timthumb file with the code that is on the google code website.

  34. I have done exactly as directed and no joy. I enabled the timbthumb “first image” feature in my theme and My flickr photos still show up as x’s on the front page where there should be pictures.

    If anyone could tell me where I could be possible going wrong I’d much appreciate it!

  35. Phew Thanks to those that replied on the other post. I got it sorted after creating the temp file in the scripts folder of the theme.

  36. Im using the script but it does not allow me to use external images.Is there a way to fix this since i like to use another site to host the images?

  37. Hi thanks so much for your development on this. I’m getting the following error in the log.

    [30-Apr-2010 08:44:37] PHP Warning: imagecreatefrompng() [function.imagecreatefrompng]: ‘/home/directory/public_html/domainname.com/wp-content/themes/ThemeName/scripts/temp/’ is not a valid PNG file in /home/directory/public_html/domainname.com/wp-content/themes/ThemeName/scripts/timthumb.php on line 312
    [30-Apr-2010 08:44:37] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/directory/public_html/domainname.com/wp-content/themes/ThemeName/scripts/timthumb.php:312) in /home/directory/public_html/domainname.com/wp-content/themes/ThemeName/scripts/timthumb.php on line 728

    Any help is greatly appreciated.

  38. Hi Ben,

    Loving Timthumb and the way that it integrates with my site, excellent work.

    Really looking forward to the image compression, I have noticed that the thumbs are pretty large at the moment which is slowing my page loading times a fair bit.

    1. Hi Tom – glad you’re liking the script. If you grab the latest version from Google code then you will see the images are being compressed already πŸ™‚

      1. Ah yes, sorry about that. Noticed that I don’t have the latest version. Doh!

        However, replacing the code just gave me a load of blank thumbs.
        I’m using it with Branford magazine and I’m a php noob.

        I’ll have to have a dig and try to figure out what’s going wrong.

      2. I am afraid I haven’t used Branford before so I don’t know if it’s using a modified version of the script or anything like that. If you right click on the image and view it in a new tab you should be able to see an error report telling you what to fix.

  39. Pingback: Using Post Thumbnails On StudioPress Classic Themes
  40. Hello there!
    Ive just started using a theme that utilizes timthumb after my Blog crashed a few weeks ago.I just noticed that timthumb doesnt allow remote hotlinking which is a bummer since I upload all my images to Flickr.

    Is there any way to allow access to flickr yet?

    I am a technical klutz and would appreciate a simple answer/guide ^^;;

  41. Hi Ben,

    I am using your excellent script on my site http://www.hi-tech-gadgets.org

    I was pulling images from the amazon feed fine until about 3 days ago.

    Any ideas? Thought it might have been the cache so I have already increased the size but still nothing..


    1. right click the broken image and open it in a new tab and it will tell you what the problem is. You’re not displaying the image src so maybe the amazon feed format has changed.

  42. Hi, I have 2 sites installed on single installation wordpress 3.0. One is domain.co.cc and another is subdomain.co.cc.

    timthumb works ok on the main site(domain.co.cc) but I get the red “x” broken link for the subdomain site (subdomain.co.cc).

    When I right click the broken image and open it up in a new tab/window, the image shows up.

    I read about timthumb not able to work with “relative” domains and I have amended the codes accordingly to point to wp-content/blogs.dir/blogid/files/…. but still the red “x” is there…

    I have definitely run out of ideas now…. please help?

  43. sorry.. typo error in previous post.. the subdomain site URL will be subdomain.domain.co.cc and not subdomain.co.cc ..

  44. Hi Ben, awesome script.
    I’ve added multiple feeds now and there hasn’t been any problems lately, however my most recent feed only pulls about 50% of the thumbnails on the homepage. The error I receive is on line 312 – not a valid PNG file. That said, when I go into the post directly (still on my site using feedwordpress), the PNG file appears fine. The issue is limited to the main page thumbs. Any idea? The site is golfforums.ca if that helps at all.


  45. Thank you for this script.

    I have seen timthumb go from 8kb to 17kb, and the CPU usage keeps increasing with every feature addition.

    Is it possible to create a timthumb lite, very small, very efficient version with optimal cache options?

    1. Hi Lisa – TimThumb already has the optimal cache options already, I always try to make sure it’s as fast as possible. The complex processing only happens the first time the image is accessed, after that the caching takes over and the hit to the server is as minimal as can be.

      Are you sure the extra cpu isn’t coming from the fact that you are using the script more and your website is becoming more popular (or some other factor). If you go backwards in time in Google code and look at the first version released, then see how that performs – what is your cpu usage like then? My guess is worse – but I’d be interested to know if it improves.

      1. I did exactly that and went to a version which is only 9kb and does not have a version number. This improved by overal CPU usage and also my bandwith went down.

        My website has not inceased in popularity, however I do use the script for every image and the homepage does have abour 20 images.

        I did turn off the cache and then really noticed how good the cache was working, so I turned it on again.

    1. you could create your own rewrite rules in htaccess to use timthumb without the ? – maybe I could write a blog post about this… nice idea – thanks πŸ™‚

      1. I wish I could, but my knowledge of .htaccess is not that good. I am going to do some reading and see if I can find something. If so, I will let you know.

  46. Hi.

    We are victims of the timthumb security hack as the file was used in a theme Arthemia we chose. A pain because we are not professional webdesigners.

    Do you have any details of how the hackers are exploiting this and what they do? Or more to the point, who to undo it?

    All of our thumbnails were removed. There seems to be some random code corruption (addresses mainly) in the mySQL table and the hacker was able to gain entry and change our admin email address for his own.

    I have upload the most recent file, I have no idea if this is meant to “just work” with Arthemia at all.

    1. Hi – really sorry to hear you have been hit by the hackers πŸ™

      Upgrading TimThumb is a good start but you need to clean out any files they infected. Tips on this are available here

  47. this is a message i got form my hosting company about problems with timthumb script…

    Hi Bojan,

    This is due to a mod_security rule which we’ve implemented to block exploits of the timthumb script when using a remote file include. I’d recommend contacting the theme developer and asking them to modify the theme to use relative or absolute paths rather than remote file includes to build the thumbnail URLs. Thank you.

    Rochen Limited

    is there anything you can do to help me here

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *