coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: michelle on November 30, 2003, 02:46:53 AM

Title: Size of intermediate pictures
Post by: michelle on November 30, 2003, 02:46:53 AM
On the configuration for my gallery, I put 725 as the "max width or height of an intermediate picture", so that people who have 800x600 as their resolution won't have the sideways scroll if the image's width is too long. But I only want 725 to be the maximum width for the intermediate picture, I don't care how big the height is. If the picture is for example, 500x1000, I don't want to have a 362x725 intermediate photo, I just want it to go straight to the regular sized photo. If the intermediate pictures had the same option as the thumbnails, "use dimension (width or height or Max aspect for thumbnail)", then I'd just put "width" (I think), but there's not an option for that in this case.

Does that make any sense? Is there any way to do this?

Thanks!

(p.s. - I searched for an answer to this, but couldn't find one, so sorry if this has already been asked)
Title: Size of intermediate pictures
Post by: hyperion on November 30, 2003, 06:22:24 AM
The thumbnail setting also controls the intermediate setting. Both will be done the way you specify.
Title: Size of intermediate pictures
Post by: michelle on November 30, 2003, 07:07:11 AM
ahh... ok, I see now, thanks!

I want the thumbnails set to have either height or width as the max, but the intermediate to just have width as the max. If I had only width as the max for thumbnails, some of them would look abnormally large since my pictures vary a lot in width/height.

Anyone know a way of doing that, or do the settings have to be the same?
Title: Size of intermediate pictures
Post by: hyperion on November 30, 2003, 01:15:07 PM
Do you know enough PHP to feel up to trying to modify it? It would be fairly easy to hard code this into your installation.
Title: Size of intermediate pictures
Post by: michelle on November 30, 2003, 03:06:05 PM
QuoteDo you know enough PHP to feel up to trying to modify it? It would be fairly easy to hard code this into your installation.

Yeah, sure
Title: Size of intermediate pictures
Post by: hyperion on December 01, 2003, 12:30:51 AM
Okay, just edit the /include/picmgmt.inc.php file.  

The main code block is located at the top, and the image resize function is at the bottom.  I would copy the function, but change the name to something like normal_resize_image().

Then remove the tests for the resize method at the beginning of the copied function and leave the code for when width is selected. Change the name of the function call for when the normal picture is resized, and you should be ready to go.

As always, make a backup.

This is the block of main code of particular interest to you:


        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;