Change to correct thumbnail filesize Change to correct thumbnail filesize
 

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

Main Menu

Change to correct thumbnail filesize

Started by jp-photo.dk, September 06, 2007, 09:24:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jp-photo.dk

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";

Nibbler

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.