Tim Thumb for External Host / CDN

I am running a copy of the tim instance on the client website. Works great, but does not support external image hosts. My clients use Amazon CDN / Flickr for all of their websites, which doesn't allow me to resize on the fly.

Has anyone found a job for this?

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

+2


a source to share


2 answers


If you have PHP 5.0+, you can make it 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) .

+2


a source


Using timthumb to generate thumbnails on the fly is pretty quick for a developer, but when it comes to cloud hosting or CDNs using external permissioned sites, it will be overkill as thumbnails will be delivered from the application host instead of the CDN.

Once you start using a CDN or cloud store, consider dropping timthumb and using a thumbnail when the image file is stored on cloud storage. Like AWS s3 has an event trigger and you can use lambda function to generate thumbnails for a specific path, templates should be modified accordingly. Yes, it seems to be some kind of work, but in the end, site users will feel the difference and the site will perform better.



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

0


a source







All Articles