Thumbnail size to be percentage NOT pixel??

I'm using the random thumbnail script (http://www.zenphoto.org/2008/01/hacks/#random-image-external-site) to display some random thumbs on my site - most of the images are landscape but portrait images get squished when setting width and height...

If I leave off the height and width parameters they just default to 50 50 (what the random.php file says). This way all the images gets squished.

I'd like to be able to set thumbnail percentages so everything stays in proportion. I'd even be ok with the square cropping used in the normal galleries - at least nothing would look out of proportion...

Thanks,
Mike

Comments

  • acrylian Administrator, Developer
    That is not possible by technical reasons. The gdlib that crops/sizes the images needs px values. What you would have to do is to get the full size of an image (see the doc) as 100% and compute the percentage you want from that into pixel values.
  • How can I use the square cropping used in the standard galleries then? As I said I just don't like when the images are out of proportion...at least the cropping keeps the pic in proportion - just cutting it off a bit...
    Thanks
  • acrylian Administrator, Developer
    I am sorry, the random image script is a third party I don't know anything about. It is surely possible but you will probably have to modify that script using our functions. Pleas take a look at the documentation.
Sign In or Register to comment.