Trouble outputting thumb to right size in page_list block

Permalink
Hi There,

I'm trying to control the size of my thumbnails to 170px x 100px - but the code seems to generate a slightly larger thumb that is 175px x102px.

Here is what I'm using to generate the thumb:
//IMAGE THUMBS
$objThumb = NULL;
// Get the file object of the image assigned to the page attribute (if any)
$objFile = $cobj->getAttribute('main_image');
// If it's a valid file object...
if(is_object($objFile) && $objFile instanceof File && !$objFile->error){
  // ...load the image helper and generate its thumbnail
  $ih = Loader::helper('image');   
  $objThumb = $ih->getThumbnail($objFile, 170, 100);
}


And here's how I'm outputting the markup:
<?php if(!is_null($objThumb)){?>
  <a <?php echo $target; ?> href="<?php echo $link; ?>">
    <?php echo '<img src="' . $objThumb->src . '" width="' . $objThumb->width . '" height="' . $objThumb->height . '" alt="Alt text here" />'; ?>
  </a>
<?php } ?>


It's been a while so I'm not sure what I've missed sorry.

Cheers

Ben

 
cmscss replied on at Permalink Best Answer Reply
It always pays to triple check which block template you're calling - the one I was actually using had the 175px image dimension in it.

Cheers