Question

I'm running a stock copy of tim thumb on a clients website. Works great but does not support external hosts for the pictures. My clients uses an amazon CDN / Flickr for all of their websites pictures which doesnt allow me to resize on the fly.

Has anyone found a work around for this?

http://code.google.com/p/timthumb/

Was it helpful?

Solution

If you've PHP 5.0+ you should be able to get it to work by adding the CDN address to $allowedSites.

function checkExternal ($src) {

    $allowedSites = array(
        'flickr.com',
        'picasa.com',
        'blogger.com',
        'wordpress.com',
        'img.youtube.com',
    );

See here (line 556).

OTHER TIPS

Using timthumb for on the fly generation of thumbnails are pretty fast for a developer, but when it comes to cloud hosting or CDN using the external allowed sites would be an overkill as thumbnails would be delivered from the application host instead of CDN.

Once you start using the CDN or Cloud Store, consider dropping the timthumb and utilze generation of thumbnail when image file is stored into cloud repository. Like AWS s3 has an event trigger and you could use a lambda function to generate the thumbnails to a defined path, templates to be modified accordingly. Yea this seems to be some job, but eventually the site users will feel the difference and the site will perform better.

This is not a solution but a suggestion for more thought.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top