[Solved]: Original pics modified after installing modpack [Solved]: Original pics modified after installing modpack
 

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

[Solved]: Original pics modified after installing modpack

Started by Walker, April 08, 2008, 10:35:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walker

I originally discovered this when I added -strip to the imagemagick command line to reduce the filesize of thumbs and intermediates, but found that it also stripped the exif data from the fullsize original.  So to eliminate mods, plugins, etc. for troubleshooting I did the following:

I installed cpg 1.4.16 into a new directory, with a new database, and provided path to imagemagick.
The only settings that I changed in config were the max filesize and dimensions for uploaded files.
I then uploaded a test pic with filesize of 1,375,140 bytes... the intermediate and thumbnail was created as expected and the original was left untouched.
I then added -strip to command line and the original is still left untouched.

Then I installed the modpack and immediately uploaded the same image into a new folder, verified that the file was correctly uploaded and reports the correct filesize via ftp, then added it to a new album in coppermine.
The intermediate and thumbnail were created with the same filesize as pre-modpack, but the original file is now only 710,124 bytes.
After adding -strip, the original is now reduced to 697,410 bytes.

I then checked the files in my live coppermine installation (with modpack) against my local backup and found that all of the full size images on the server are smaller than my local copies, though mostly just by a few hundred bytes.  I had resized all of these images to a max height of 1200 with IrfanView before uploading these though (I had also manually created the intermediates and thumbs).

So the original image is being processed with imagemagick (though not resized) when the modpack is installed.  Is this expected behaviour?  If so, please forgive my ignorance, but I could find no mention of it anywhere.  Otherwise, please help.  It is important to me that the original files be left unmodified, as they are to potentially be used for printing.

Thank you

Walker

I just tested with GD version 2.x and experienced the same results, the original has been reduced to 635,920 bytes

Stramm

If you don not want the fullsized image to get recompressed, disable watermarking

Walker

Thank you for your response.

This is a new installation of cpg + modpack with all default settings.  Watermark image is disabled.  So I disabled watermark custom thumbs also, and changed which files to resized only.
The issue persists.

Stramm

if it doesn't create orig_ files, then the modpack doesn't modify the fullsized image. Possible if resize options are enabled (standard coppermine)

Picture and thumbnail settings - Auto resize images that are larger than max width or height

Walker

That's it, disabling "Auto resize images" resolved the problem.  However the image was well within the allowed size and was still being processed anyhow.  This occurs only with the modpack installed, the original is left untouched as expected when using vanilla coppermine install.  Easy enough to work around though.

Thanks for your help Stramm, I knew it had to be simple.  I'll have to stop posting just before I go to bed :)

Stramm

Will have to check if that happens on my installs, too. If so it'll need correction.

Walker

Just curious Stramm, have you had time to test this?
Was it just me, or were you able to reproduce?

Stramm

Now that you remembered me I looked through the code with your settings in mind and saw that it'll exactly do what you describe. A check is missing if the image size is actally bigger than the configs 'Max width or height for uploaded pictures/videos'. So it always resizes the image.

in picmgmnt.inc.php find
elseif (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0))){

and replace with
elseif (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']){ //$CONFIG['auto_resize']==1

Walker