Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

jp-photo.dk

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

I've made a change in the /include/picmgmt.inc 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";
Logged

Nibbler

  • 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.