Problem with thumbnail size

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 28, 2008   (RSS)

By Mel - May 24, 2008

Hi everyone,

Have a problem with thumbnail size

Maximum image size before resizing kicks in is set at
Height 198 & Width 148
Create image thumbnails set at 60x60

When I upload an image size 198x148 it creates a thumbnail Height 60 Width 45 is it supposed to do this or should it be creating them 60x60 as I specified

Or is there a way I can force it to create a 60x60 thumbnail and not a proportional thumbnail

Thanks Mel

Re: [mel] Problem with thumbnail size

By Dave - May 24, 2008

Hi Mel,

No, it will always maintain the proportion ratio of the original images, otherwise you'd end up with a stretched image.

What is it you are you trying to do?
Dave Edis - Senior Developer
interactivetools.com

Re: [mel] Problem with thumbnail size

By Dave - May 24, 2008

Hi Mel,


Now this is the bit where I start getting stuck

On the region page I can do a record query to call up all records for let's say region1 but how do I get a specific thumbnail image to show alongside each record for example the first image on the matching details page


You do it exactly the same way as if you were going to list _all_ the images, but you just add a <?php break; ?> tag to tell it to stop after just one. Like this (replace $record and 'upload' with whatever your variables and fields are named):

<?php foreach ($record['uploads'] as $upload): ?>

<?php if ($upload['hasThumbnail']): ?>
<img src ... >
<?php break; ?>
<?php endif ?>

<?php endforeach ?>


Hope that helps! Give it a try and let me know how it goes.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Problem with thumbnail size

By Mel - May 28, 2008

Hi Dave,

The <?php break; ?> done the job

Thanks Mel[:)]