RandomImage heightxwidth + greythumb

Hello!

I have been wondering how I could edit following code so that I could determine width and height of random image. I tried almost everything.

<?php
$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
<img src='". $randomImage->getSizedImage(150) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />
';
?>

...and is it somehow possible to turn that random image to grey but the orginal (when clicking the link) would stay coloured.

Comments

  • acrylian Administrator, Developer
    1. You can get the width and height of that image with `$randomImage->getWidth()/$randomImage->getHeight()`. Or what do you mean?

    2. There is not Zenphoto function for this but you probably can something for that using the GDLib's functions.
  • Oh sorry, I spelled wrong.

    I meant that I could adjust the thumb size without touching <img style="width: blaa; height: blaa"....

    So like
    $randomImage->getSizedImage(150x130)

    or something with working function.
  • The Effervescence+ theme uses the image size in creating the surrounding frame. You can look at that theme to see how it does this.

    There are a number of custom image thumb functions depending on what you want to accomplish. Please search the functions guide for these functions.
Sign In or Register to comment.