Member
Member
zloh   2008-01-12, 15:07
#1
Hi..
I'm using a variant of the effervescence theme, and my problem is with the random image function "stretching" any images in portrait orientation/aspect ratio (which are thinner than the random banner)
- i don't want to make the tall-skinny images any bigger because they'll be too tall, and they're fine for normal use
- so is there a way to get a random function to just skip any images that aren't wide enough? (e.g. anything with a width less than 600px)

apologies if this is just obvious..

Thanks in advance for any advice!
Member
Member
sbillard   2008-01-12, 17:45
#2
You will have to add code to the theme to check the width of the image returned and get another if it is too narrow.
Member
Member
zloh   2008-01-13, 02:36
#3
- i'm sure if i was a programmer, and not just a dabbler, this would only take a sec, and be very easy to do..
maybe someone else could give me a basic example of how this can be done?

anyway, thanks for your reply! ZP is easily the best php gallery currently in existance.
Member
Member
sbillard   2008-01-13, 03:20
#4
OK:

Where the code reads: ` <?php printHeadingImage(getRandomImages()); ?>` change it to
`<?php

$image = getRandomImages();

while (!is_null($images) && !isLandscape($image)) { $image = getRandomImages(); }

printHeadingImage($image);

?>`

Warning: I have not tried this. Also, there may not be a landscape image.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.