Advanced search  


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.

Pages: [1]   Go Down

Author Topic: Change to correct thumbnail filesize  (Read 5780 times)

0 Members and 1 Guest are viewing this topic.

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Change to correct thumbnail filesize
« on: September 06, 2007, 09:24:57 pm »

I've made a change in the /include/ to correct the filesize of thumbnails. I was getting filesizes around 50kb for thumbnails sized 100x50 pixel.

The change only affect ImageMagick conversions.

I've just added a -thumbnail option. The function resize_image is probably also used to resize the real images, and for this to work 100% should only include the -thumbnail if it's really a thumbnail being created. I was thinking in ways of checking against the $thumb_use and only adding -thumbnail if this was either "ht" or "wd". But since I'm not resizing the actual images in my gallery on upload I didn't need it that much.

Old line:
$cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file";

New line:
$cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -thumbnail {$destWidth} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file";


  • Guest
Re: Change to correct thumbnail filesize
« Reply #1 on: September 06, 2007, 09:29:04 pm »

You can use -thumbnail on intermediate files too. I don't know what version of IM you need for this option, but it should be considered for a future release.
Pages: [1]   Go Up

Page created in 0.088 seconds with 19 queries.