Size of intermediate pictures Size of intermediate pictures
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Size of intermediate pictures

Started by michelle, November 30, 2003, 02:46:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michelle

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)

hyperion

The thumbnail setting also controls the intermediate setting. Both will be done the way you specify.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

michelle

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?

hyperion

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.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

michelle

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

hyperion

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;
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)