forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: jp-photo.dk on September 06, 2007, 09:24:57 pm

Title: Change to correct thumbnail filesize
Post by: jp-photo.dk 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";
Title: Re: Change to correct thumbnail filesize
Post by: Nibbler 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.