Re: [rasbro] Thumbnail Images on Listings Level
You can specify two different size for image uploads. So if you need 1 fullsize image and 2 thumbnail sizes you'd have to do it some other way. But if two different thumbnail sizes would work you can do it like this: (Both sizes are set in the field editor and apply to new uploads only).
The first size is set with "Resize images larger than...". Any images uploaded larger than this will automatically be resized. You can display these images like this:
<img src="<?php echo $upload['urlPath'] ?>"
width="<?php echo $upload['width'] ?>"
height="<?php echo $upload['height'] ?>" />
The second one is the thumbnail created with "Create image thumbnails". That will automatically get created if enabled and can be displayed like this:
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>" />
And if you want to just let the browser resize it, using the thumbnail will give you less distortion since it's already smaller and specifying only height or width will make the browser figure out the right resize ratio:
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="50" />
Hope that helps.
Dave Edis - Senior Developer
interactivetools.com