Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: Original pics modified after installing modpack  (Read 5241 times)

0 Members and 1 Guest are viewing this topic.

Walker

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
[Solved]: Original pics modified after installing modpack
« on: April 08, 2008, 10:35:45 am »

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
« Last Edit: April 17, 2008, 03:34:39 pm by Stramm »
Logged

Walker

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Original pics modified after installing modpack
« Reply #1 on: April 08, 2008, 10:40:49 am »

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

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Original pics modified after installing modpack
« Reply #2 on: April 08, 2008, 01:18:27 pm »

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

Walker

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Original pics modified after installing modpack
« Reply #3 on: April 08, 2008, 08:19:18 pm »

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.
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Original pics modified after installing modpack
« Reply #4 on: April 08, 2008, 08:22:51 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Original pics modified after installing modpack
« Reply #5 on: April 08, 2008, 08:43:59 pm »

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 :)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Original pics modified after installing modpack
« Reply #6 on: April 08, 2008, 09:02:50 pm »

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

Walker

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Original pics modified after installing modpack
« Reply #7 on: April 17, 2008, 01:32:50 pm »

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

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
[Bug]: Re: Original pics modified after installing modpack
« Reply #8 on: April 17, 2008, 02:32:19 pm »

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
Code: [Select]
elseif (((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0))){
and replace with
Code: [Select]
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Original pics modified after installing modpack
« Reply #9 on: April 17, 2008, 03:25:14 pm »

Perfect.  Thanks again.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.