coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: je79ayps on April 03, 2004, 10:26:14 AM

Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 03, 2004, 10:26:14 AM
I would like that thumbs only are 75px heigh so that it doesn't change the design regarding the width and height of the tables. I would like my normals only to be 640px max aspect.

As I see this is not possible when I have chosen "height" in the config. Becuase the my normal pictures could end being more than 640px in width.

Either I should choose "max aspect" and live with the thumbs being 75px overall. Isn't this correct?

Here's my config part:

Pictures and thumbnails settings
Quality for JPEG files: 100
Max dimension of a thumbnail: 75px
Use dimension ( width or height or Max aspect for thumbnail ): height
Create intermediate pictures: yes
Max width or height of an intermediate picture: 640
Max size for uploaded pictures (KB): 512kb
Max width or height for uploaded pictures (pixels): 1280
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 13, 2004, 10:11:52 AM
*bump*
Title: Keep thumb and normal pictures at max aspect
Post by: hyperion on April 13, 2004, 05:45:27 PM
You can hardcode the settings in include/picmgmt.inc.php.
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 15, 2004, 09:39:29 PM
Thanks, but is it line 25 I should fool around with:
    $thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $filename;
Title: Keep thumb and normal pictures at max aspect
Post by: hyperion on April 16, 2004, 12:39:00 AM
No, that is the file path. You want the resize functions, which begin on 28.

   
if (!file_exists($thumb))
        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
            return false;

        if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'] && !file_exists($normal))
            if (!resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))
                return false;
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 16, 2004, 08:16:15 AM
OK, but how do I set the pixels I want?

I guess it's the $CONFIG['thumb_width'] I should concentrate about but should I just make somthing like: $CONFIG['75']?

But it isn't really the width I want to set - it's the height so that the thumbs only are 75px in height.
Title: Keep thumb and normal pictures at max aspect
Post by: hyperion on April 16, 2004, 08:36:32 AM
Change:


        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']))


to:


        if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], 'ht'))


It says $CONFIG['thumb_width'], but it is really just the length for the dimension specified in $CONFIG['thumb_use'].

Then set the Config console to max aspect. Your thumbs will get resized by height, and your intermediates will get the max aspect treatment.  Pixels for both intermediates and thumbs should be specified in the Config console.
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 16, 2004, 08:19:43 PM
Okay, got it - but it doesn't seem to work.

If you look at http://www.brutaldeluxe.dk the horistonal picture is only 75px in width but I want this to be 100 px and then the height should be 75 px.

Config:

Pictures and thumbnails settings
Quality for JPEG files    80
Max dimension of a thumbnail *   75
Use dimension ( width or height or Max aspect for thumbnail )*   Max Aspect
Create intermediate pictures   Yes
Max width or height of an intermediate picture *    640
Max size for uploaded pictures (KB)    1024
Max width or height for uploaded pictures (pixels)    2048
Title: Keep thumb and normal pictures at max aspect
Post by: hyperion on April 17, 2004, 03:54:58 AM
Hmmm . . . This may require more than that. Look at the thumbnails using the FTP client (no browsers) to see if the files were actually resized correctly.  This may be an image tag issue.
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 17, 2004, 09:24:21 AM
On a note - the 2 pictures were uploaded after I made the changes to the code.

If I look at the pictures they have the rigth dimension: 56x75 and 100x75 - so that should be allright...
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 18, 2004, 03:13:54 PM
I guess I want the same function as height sizing on thumbs in categories.

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.upit.dk%2Ffiles%2FSNAG-0000.jpg&hash=6190024bca6b263a91375fd299d668b542a30bcb)

And the film strip:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.upit.dk%2Ffiles%2FSNAG-0001.jpg&hash=4c41629af33749ee3923f32bd69a38a1c591f5ff)

Hope this is possible...
Title: Keep thumb and normal pictures at max aspect
Post by: hyperion on April 20, 2004, 01:03:31 AM
Yes, this is possible. I am too busy to work on this right now, but the issue is an HTML image tag issue.  You need to look in thumbnails.php and /include/functions.inc.php.  The relevant functions are display_thumbnails and compute_image_geom. You will need to add an argument to the function to return a custom image geometry for thumbnails instead of relying on the max aspect setting.
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 20, 2004, 08:22:35 AM
OK, thanks for your help so far hyperion!

I'll try and mess around with the two files - we can't be that far from the goal since the thumbs are created correctly, so...

Perhaps gaugau or casper can be of assistance for the last part?
Title: Keep thumb and normal pictures at max aspect
Post by: Casper on April 20, 2004, 10:47:55 AM
I wish I could help, but it's all alien to me.  The other people who really could help, other than Gaugau, such as Tarique, Omni, Nibbler and the other devs, are all quite busy getting 1.3 ready for stable release at the moment.
Title: Keep thumb and normal pictures at max aspect
Post by: je79ayps on April 20, 2004, 02:33:08 PM
OK, no problem - I'll live with the "problem".

Perhaps it could be a feature in the 1.3 version. To use different scaling for the normal and thumb pictures that is.
Title: Keep thumb and normal pictures at max aspect
Post by: Joachim Müller on April 20, 2004, 11:07:07 PM
sorry, no additional features for cpg1.3.0 - we had a feature freeze and are within the pre-release beta testing phase.

GauGau