Remove suffix from thumbnails

Hello - I'm linking to a flash plugin that I can't edit and I need the thumbnails to have the same filename as their source images.

It would make my life a lot easier if I could remove the '_100_cw85_ch85.jpg' suffix from the generated thumbnails!! Is there a simple way to do this in zen? I've noticed that if I rename them manually or in php the thumbnail is re-generated so that's out of the question. Another possibility is mod_rewrite but it's not working for me...

Thanks - GKTD

Comments

  • You don't need to create a thumbnail of the image yourself. Just place an image of the same name in the same album as the video. If the video is show.flv then an image named show.jpb will be used as the thumbnail.
  • Thx for your time - I'm not actually dealing with vids, just images in galleries and thumbs in the cache. I want zen to generate thumbs for me but without the suffix so:

    Main Image: www.mysite.com/zen/albums/discs/disc1.jpg

    Thumb Image: www.mysite.com/zen/cache/discs/disc1.jpg

    NOT

    Thumb Image: www.mysite.com/zen/cache/discs/disc1.jpg_100_cw85_ch85.jpg

    If that's doable...
  • trisweb Administrator
    Not really. Zenphoto uses the same directory for thumbnails of different sizes, as well as resized main images, and all resized images of any kind. It needs to keep them separate and unique, hence the suffix.

    Out of curiosity what's the purpose of this flash plugin? Perhaps you could find a different one that's more configurable?
  • What about a little php script that loads it for you, the URL might be in the right format:

    Main Image: www.mysite.com/zen/albums/discs/disc1.jpg
    (so, main directory: www.mysite.com/zen/albums/discs/)

    Thumb Image: www.mysite.com/script.php?file=zen/cache/discs/disc1.jpg
    (thumb "directory": www.mysite.com/script.php?file=zen/cache/discs/)

    If the Flash thing accepts "www.mysite.com/script.php?file=zen/cache/discs/" as a valid directory to look for the thumbs, you could have script.php do essentially what mod_rewrite would, and slap on the appended part of the filename and load the file.
  • I think you got it in one Alex. The plugin is simpleviewer - a guy wants me to hook it up with his zen images and the documentation states that the main images and thumbs MUST have identical filenames, you only get to supply a path to the main/thumbs directories.

    If simpleviewer will swallow a php page + image name instead of a full filename, then I can add the suffix in thumbs/getImage.php but leave it out in main/getImage.php...

    Nothing in life is simple chaps - not even simpleviewer apparantly.
  • You should take a look at the Effervescence+ theme. It uses simpleviewer as one of its personalities. It does not have any issues with thumbnails--simpleviewer creates them itself.
  • That sounds pretty sweet, although some miserly part of me doesn't like the thought of duplicating thumbnails when Zen's are already there. It's negligable in terms of disc space + admin I suppose but still...

    Anyway it's sorted now. I swapped the thumb dir in the XML for a php script. If anyone's interested:

    -Call-
    `image

    image`

    -getZenThumb.php-
    `//get filename + zen suffix

    if (isset($_GET['fn']))

    $imagePath = $_GET['fn'] . '_100_cw85_ch85.jpg';

    else

    $imagePath = 'error';

    header("Content-Type: image/jpegn");

    header("Content-Transfer-Encoding: binary");

    readfile ($imagePath);`

    I'll look into a theme next time - using Zen for the 1st time has been great so I'll be back thx for your help fellas.

    (p.s. don't know if you're doing some admin ATM but the image links on zenphoto.org/themes are a bit fruity: www.zenphoto.org/themes/images/themes/effervescenceplus_large.jpg)
  • trisweb Administrator
    Should be http://www.zenphoto.org/zp/theme/ , not zenphoto.org/themes... not sure where you got that URL.
  • ah nuts I've been emptying my cache for testing all morning so I can't tell you... maybe just a bad link in a post? I can't find it now.
  • That link would be to one of the thumbnails for the theme descriptions.
  • acrylian Administrator, Developer
    zenphoto.org/themes was the old link before we did the new site.
Sign In or Register to comment.