Is it possible to have "Fixed" width for the intermediate image? Is it possible to have "Fixed" width for the intermediate image?
 

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

Is it possible to have "Fixed" width for the intermediate image?

Started by cgc0202, November 05, 2006, 11:57:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cgc0202

Hello,

In the  "Files and thumbnails settings"

One of the choices allowed was this:

Max width or height of an intermediate picture/video **

Is there a way around this so that it is not "either/ or" option for the width or the height; but  rather to  have fixed width (+++) for the size of the intermediate image?  I consider the changing width rather distracting and not very appealing for the slide show. 

I realize that fixing the width can cause its own problem when there is an extreme ration between the width and height, but those are seldom encountered.

CGC
_______________
(+++) such options are allowed in the thumbnails that I do not use, and opted for the "exact" size of the thumbnail that could be enabled by the Stramm mode.


cgc0202

Quote from: Nibbler on November 06, 2006, 12:07:56 AM
Set 'Use dimension' to width.

That is for thumbnail Nibbler.  I have that as exact, so that I can have fixed width and height for all the thumbnails. There is not the same feature to set the same for the intermediate file size.

CGC

Nibbler

The setting is used for intermediate pics too. If you have issues with the modpack then post there.

Stramm

if you use 'exact', then the modpack checks if it's resizing a thumb or the intermediate, only the thumbs get cropped, for the intermediate image the modpack's using 'max aspect'.

To change this behaviour you'll have to modify include/picmgmnt.inc.php... find
($CONFIG['thumb_use'] == "ex") ? $resize_method = "any" : $resize_method = $CONFIG['thumb_use'];

and change "any" to "wd" for width or "hd" for height

cgc0202

Quote from: Stramm on November 06, 2006, 01:01:30 PM
if you use 'exact', then the modpack checks if it's resizing a thumb or the intermediate, only the thumbs get cropped, for the intermediate image the modpack's using 'max aspect'.

To change this behaviour you'll have to modify include/picmgmnt.inc.php... find
($CONFIG['thumb_use'] == "ex") ? $resize_method = "any" : $resize_method = $CONFIG['thumb_use'];

and change "any" to "wd" for width or "hd" for height

Thanks Stramm,

To clarify, I still want the thumbnails and mini "exact" (I am using a square right now), but I want the intermediate to be fixed width.

And, is there a need to update, after the change is done?  Or, the Admin Tools approach be sufficient to make the changes in the resizing -- without any need for update?

Thanks.

CGC




Stramm

as already statet, this'll change the resize method for the intermediate image when you set 'exact' in config. Thumbs, minithumbs will stay cropped

Of course you'll need to recreate the intermediate images (admin tools). No further update??? needed (afaik, but I haven't tested this hack... that's your part)

cgc0202

Quote from: Stramm on November 07, 2006, 11:35:27 AM
as already statet, this'll change the resize method for the intermediate image when you set 'exact' in config. Thumbs, minithumbs will stay cropped

Of course you'll need to recreate the intermediate images (admin tools). No further update??? needed (afaik, but I haven't tested this hack... that's your part)

OK, thanks for clarifying Stramm.  I can do the rest.  I just want to make sure because I have thousands of pics in the database already. I will test it with a new gallery instead of my actual site.

Thanks again.

Cornelio

cgc0202

Hi Stramm,

Just an update on this.  The constant width, as outlined above (using the modified script), works when the "batch upload" or  "upload file" procedure -- when the photos are first processed.  However, when I have to do any "resizing" using the "Admin Tools", the resized intermediate image reverts back to the default setting (i.e., either width or height becomes the max intermediate size) rather than as specified in the script modification -- constant width (or a larger height for vertical images).

Cornelio

floatingworld

I couldn't find those lines of code in the include/picmgmnt.inc.php file... am I missing something?

Stramm

Quote from: cgc0202 on March 26, 2007, 02:51:31 AM
Hi Stramm,

Just an update on this.  The constant width, as outlined above (using the modified script), works when the "batch upload" or  "upload file" procedure -- when the photos are first processed.  However, when I have to do any "resizing" using the "Admin Tools", the resized intermediate image reverts back to the default setting (i.e., either width or height becomes the max intermediate size) rather than as specified in the script modification -- constant width (or a larger height for vertical images).

Cornelio

hmm.. yes, you'll have to search through util.php and find similar code as in picmgmnt.inc.php (the one you just edited) and modify it as well. I forgot that I had to do a big bunch of modifs there as well for img recreation

Stramm

Quote from: floatingworld on March 26, 2007, 02:57:15 AM
I couldn't find those lines of code in the include/picmgmnt.inc.php file... am I missing something?

hmm.. I copy/ paste the code line I posted above into the search box of my editor and it spits out (for picmgmnt.inc.php modpack v1 1.4.10) line 70. This may be different for other versions

cgc0202

Quote from: Stramm on March 26, 2007, 08:19:37 AM
hmm.. yes, you'll have to search through util.php and find similar code as in picmgmnt.inc.php (the one you just edited) and modify it as well. I forgot that I had to do a big bunch of modifs there as well for img recreation

Hi Stramm,

This further correction did not work.

This is what I changed the
util.php:
($CONFIG['thumb_use'] == "ex") ? $resize_method = "wd" : $resize_method = $CONFIG['thumb_use'];

picmgmt.inc.php
($CONFIG['thumb_use'] == "ex") ? $resize_method = "wd" : $resize_method = $CONFIG['thumb_use'];

website
CPGv1410-Stramm modpack

Please select the Classic theme (the theme selector is at the bottom)  to view images. [The Supernova theme used here has been changed so that the overlay.gif masks the full size image.  There is still a "bug" possibly because the displayed image was the full size rather than the intermediate size -- this was reported in the appropriate thread.]

Batch upload results:
The constant width was apparent, see for example:
Test 1

After Admin Tools (simulated resize)
Test 2

Before the "Admin Tools", the intermediate size for the Test2, following the Batch Upload, had a fixed width as the Test 1 image.  However, after the Admin Tools (simulated resize), the fixed width was "overridden", in spite of the util.php modification.

Cornelio


Stramm

make sure you have overwritten the original modpack util.php

other than that I can't give you much advice. That's cause I do not use the modifications you made and therefore I'm not able to recreate your results. And in addition to that I even do not know your settings

Just from the logic I'd say it'll should work as expected