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: [Dave] Problem with thumbnail size

By Mel - 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?


Hi Dave thanks for the rapid reply what I am trying to do is keep all thumbnails a uniform size so the answer will be to upload the large images all cropped to the same height and width thereby all thumbnails should be uniform in height and width

As a follow up question:

I am going to have a number of different regions and in each region will be products specific to that region and each product will have their own product page

So I think it would work something like this - I have a template for product page - when entering the individual product data I set up one or more fields for region1 region2 region3 etc or could I have them in a string seperated by commas in just one entry field - would MySQL pick out an individual region that way

Also on the product page I will be having 4 images either as thumbnails or full size images (have not decided which way to do it yet may use the lightbox method if I feel adventurous)

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

Mel

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