A couple of weeks ago I posted a brief history of TimThumb, the image resizing script I am responsible for. I said in the conclusion that I was looking for beta testers, and I am, however I have been a bit slack at sending out the script to the people who ask.
So, I thought I would upload it for everyone to download so that we can give it to a wider audience.
Download TimThumb BETA here
Installation
Firstly I would recommend renaming your existing TimThumb script incase something goes horribly wrong. Then download the file linked above and put it in the same location as your current version. So far so normal (although do note I added an 's' to the file extension so be sure to rename to '.php').
After this you will need to create a new folder in the same directory as the cache folder. Currently I am not sure if this will remain or if I should use the cache folder or if I should do something totally different - feedback on this would be welcome. You should name the new folder "temp" and give it folder permissions 777.
What to test?
The main thing I want tested is the offsite image resizing. Currently only flickr.com, picasa.com, blogger.com, and wordpress.com are supported (and I have only tested Flickr myself) but these settings will be configurable in the future.
Feedback
Any and all feedback you can give would be most welcome. Simply post your thoughts in the comments below - and thanks a lot for being so willing to give you time to help improve TimThumb.
134 Responses to “TimThumb Beta Test” Leave a reply ›
Hi Ben,
Script works very fine on local but when it goes to production an error returns such as "Access to requested resource is denied on this server"
Do you know why that happens?
Hey Mehmet. This is probably to do with directory permissions. Make sure the only directories that are set to 777 are the temp and cache ones. The rest should use the normal settings (644 I think)
Hi Ben,
it looks like this beta version isn't going to resize external URLs with a space in it. I tried find/replace the space with %20 but without any results.
http://www.mydomain.com/...0&w=150&zc=1&q=80A url like above is not working for me and results in PHP errors:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/tandenb/domains/mydomain.com/public_html/utils/thumb.php on line 308
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/tandenb/domains/mydomain.com/public_html/utils/temp/wenger 50.jpg' is not a valid JPEG file in /home/tandenb/domains/mydomain.com/public_html/utils/thumb.php on line 308
Warning: Cannot modify header information - headers already sent by (output started at /home/tandenb/domains/mydomain.com/public_html/utils/thumb.php:308) in /home/tandenb/domains/mydomain.com/public_html/utils/thumb.php on line 726
Unable to open image : /home/tandenb/domains/mydomain.com/public_html/utils/temp/wenger 50.jpg
Other images do work.
Yours
urls shouldn't have spaces in them, that's bad practice. I would recommend renaming the image and trying again.
I actually did that Ben. Folder structure is scripts, inside the folder scripts there is cache folder and timthumb.php
cache folder is set to 777
scripts folder is set to 755
timthumb.php is set to 644 (default)
I am trying to find the problem since 2-3 days with no luck..
I read between the lines: Mehmet doesn't have a /temp folder!
Create this behind the scripts, beside cache folder as it's needed for the external images.
Joern, you... you are the man.
I've been hacking away at timthumb for 5-6 hours steady... I can't even smell right anymore.
I had Mehmet's identical problem, could NOT solve it until tried Ben's version and I read your comment. /temp fixed everything.
Thank F*** it's finally fixed... and thank Joern! ha
Cheers,
Mike
Hi there,
great work on timthumb, is there any workaround for resizing external images?
hi there,
thank you very much for this code.
I have it enabled in my site,
and I made it to resize external images from all sources.
now I saw that I there's no limit for the thumbs generated,
I just made a w=20.000 & h=15.000 thumb... that's quite scary.
is there a way to limit that?
cheers!
can you please have a look at my side...
obviously it doesn´t work...
I uploaded the new timthumb.php file and tried it out with this pic http://www.tourendatenbank.com/gps/testbild/ - on the main site you can see that there is no thumbnail..
but in the source code you can see that it is still
can you help pls.
thank you.
bergblume
@Ben I'm talking actually about an external/remote domain so I don't have any control over whether there are spaces or not in the filename.
Anyone had any luck getting the new version to draw and resize images from Amazon?
- I have made sure the cache and temp folders are 777.
- I tried adding "amazon.com" to the allowedsites array.
Still wont pull them though.
Anyone have any luck with it?
@Mark I haven't tried to get Amazon to work, but their images are typically hosted at images-amazon.com not amazon.com.
@ Frank -
Thanks for the update on it! I tried that one before with no luck. I think it may be on my server end, as nothing seems to be writing to the temp folder at all.
Tried permissions of both 777 and 755 (Hostgator server) but I may need to dig deeper than just permissions on it, since its coming from an outside domain.
Thanks again,
Mark
Can anybody explain to me how you get this to work as I have copied the code into my timthumb.php on wordpress and changed folder permissions on my host and still just x's where the picture should be.
What else do I need to do to make it work because in every post I read something else but still at a loss as to what steps I need to take next! Do I use the custom CSS in my theme or the "first image" option?
Where is it that I put "allowed sites" as I am seeing alot of talk about that but no instructions!!!
Do I need to further customise the actual timthumb code or should it be ready to go?
I was having trouble getting this to work with external images residing on https:// addresses. I couldnt find the source of the problem but i added the following line in at the beginning of the cleanSource function
$src = str_replace('https://', 'http://', $src);its more of a hack than a fix, which simply changes the checked image src to a regular http:// path, but with most image hosts you can use either (https or http) so its working for me now as expected.
i have to say that your plugin is the worst thing ever, i use 100% external images and all the damn themes use this plugin so they are all usless to anyone trying to use external images. i have over 30k images on my site and it would take up to many resources to host them all on my site, so please fix this thing
Hi - I'm afraid if you don't like it you'll have to change it yourself. Opening up the script to resize images from any website is a massive security risk so I am not willing to risk the thousands of websites that use the script in this way. Additionally if you use the script it will cache the images on your server anyway so you will still end up hosting the 30000 images.
As you say it's used in many themes, and as such is used on many more sites so it can't be that bad.
i cannot create thumbnails for an image with this kind of url:
http://rendezvous.fnac.com/...ArcGEDLire.asp?iddoc=65587
Globally it works only with an url like this *.jpg/png/gif
Is there a way to make it work with this king of url ?
Thanks
Francois
Hi - you should url encode the urls. In php it would be something like : $url = urlencode($url); and then echo that inplace of your previous url. Do that and it should resize fine
Wow that is extremely cool! I was having trouble getting it to work, but then i re-read the directions. I didn't have a temp folder so the script only worked on self-hosted images. Doh! I am usually really good about that too. But after my palm left my forehead, I got it squared away, added youtube to the approved sites and that works a treat. I've got a ways to go to get it to automatically pull youtube thumbs from embedded videos, but it is a really good start. Thanks so much.
Hello Ben,
Your contact form is not working, returns an error. http://www.binarymoon.co.uk/contact/
I am trying to get animated .gif files to work with TimThumb ...and in the process I have caused some sort of code error, as one set of images isn't reducing or left justifying anymore.
Hi - I tried the contact form and it worked fine. Were you seeing an error when you tried it.
Unfortunately I don't think TimThumb works with animated gif files. To be honest I don't remember ever trying one so I'm not sure what will happen. It does work fine with normal gifs though.
hi Ben-
So do you think it is not possible to alter TimThumb to allow for animated gif files?
Here is the error on your contact page: http://www.binarymoon.co.uk/contact/
http://www.amiedigital.com/binary-ss.png
(I filled all fields in and entered captcha correctly)
I've never tried editing gif files but I would guess it's not as easy as a normal image file. The problem is there are multiple frames with paletted colours which means that even if I could work it out it would probably not look as good as you'd like. I will add it to the "to look into" list but I won't make any promises I'm afraid.
Can we make some changes in the script so that, it reads images with spaces (%20) in their path?
Thanks for the great script,
Hi suhas - if you add a bug report to Google code then I won't forget about it
http://code.google.com/p/timthumb/issues/list
It definitely works w/ youtube.com but I am running into a difficulty in the way that youtube names their screenshot images.
http://img.youtube.com/vi/aAYVY2eLMck/0.jpg
Basically they ALL end in 0.jpg or the small ones are default.jpg. So then on my index page if I am displaying thumbnails for 4 different videos, timthumb displays the same thumbnail... I presume b/c they all look to have the same name?
I know this is beyond the scope of support, but I am going to take a look at this today. If you had any work around suggestions I would really appreciate it. Perhaps it could be a cool feature to add to timthumb.
Cheers,
-kathy
Hi Kathy - have you updated the plugin to the latest version of the script? I think this has been fixed (http://code.google.com/p/timthumb/) - if it's not there then add a bug report to the issues list and I will take a look when I next go through the bugs.
Ben,
Thank you so much for your quick reply! I updated to the latest SVN version and you were right, that problem has already been taken care of. Awesome work. Thank you so much for sharing this with everyone!
-Kathy
Hello i tried to encode the url but none of my thumbnails were working
i tried to replace only "?" by "%3F" which is the corresponding enconding for "?" carac and it doesn't work too
here is my example
Thanks for your help
http://www.yvelinesinfos.com/...p;w=80&zc=1&q=80
hello,
very great script, but I'm trying to get it working with youtube. Is there a way to "auto discover" a youtube video in a post (using wp) and get the image and thumbnail?
thanks for your help!!!
This script worked perfectly for me - I think this script would be great to resize profile pictures in conjunction with the Twitter/Facebook API so I'll be eagerly awaiting any update with extended remote resizing features.
Thanks!
Hi
thanks for this great script.
I'm worry about CPU Usage
Hi Mohsen - There's going to be extra work for your cpu to do since the images are resized but i've done as much as I can to keep it nice and fast. The image caching is quite solid, and I am very conscious of keeping things fast so if you have any ideas for improving the speed I'd love to hear them.
Hi there, i fill up sites with datafeeds. Now i have a datafeed that has the images links as follows http://www.goedkoopstekralen.nl/...00005&type=normal and the images don't show up.
Guess it has to do with the external url stuff wich i tought to have fixed with a tinthumb version i downloaded somewhere.
Maybe it is because there is no jpg or gif in the externel link. Anybody have a solution?
Hey there!
Ive come across this neat page some time after my initial question.
Ive installed this Version of Timthumb yet I get the same result.Images from Flickr arent showing up at all.
I dont know where the problem might lie and hope you can give a newbie some hints where to look and what to try.
Btw does the newest timthumb on google also allow pictures from Flickr?
Thanks!
Hi - the version on Google code does work with Flickr (without modification if I remember correctly). I would use the version of the code that is on google code as it's more up to date than this is.
Thank you for the beta test vision it is really very useful for me, I am waiting for the advance version so that I'll be able to add more remote images to my blog, I tested it with flicker and it works charm.
Hi - the final version is released on Google Code. In fact there have been quite a few releases since this post was written.
Fantastic - Its just what I was looking for when I was migrating from an old domain to a newer one. I did not want to move the images, and the original timthumb did not work. This was so simple and works just as required. thanks millions.
glad you found it useful