phpThumb action on specific image

Discussion in 'PHP' started by pondlife, Dec 4, 2006.

  1. #1
    Hi All,

    I'm using phpThumb on my site to create my thumbnails and it's a great tool but I'd like to be able to spawn an action whenever a certain thumbnail is created.

    You can configure phpThumb to display an image of your choice whenever it can't find one.

    Here's the config file entry:

    $PHPTHUMB_CONFIG['error_message_image_default'] = 'images/BrokenLink.gif';

    Is there an easy way that I could get this config entry to do something else/perform another function?

    Thanks :)
     
    pondlife, Dec 4, 2006 IP
  2. Xig

    Xig Peon

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have GDlib or ImageMagick installed on the web server, you can create a PHP script that returns an image, while also executing other PHP code.

    For example, you can use this sample code in a file called "broken.gif.php" and reference that script in your phpThumb config file.

    Hope that helps
     
    Xig, Dec 4, 2006 IP
  3. pondlife

    pondlife Peon

    Messages:
    898
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Xig, thanks for the response. Yep, my server has GDlib installed (phpThumb uses this).

    I've had a look at the link you've provided - I think it may point me in the right direction, thanks.

    :)
     
    pondlife, Dec 5, 2006 IP