forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: rivers on December 17, 2007, 04:20:38 pm

Title: huge file size for intermediate (normal_) images
Post by: rivers on December 17, 2007, 04:20:38 pm
Problem:
Intermediate images have HUGE file size.  Larger than original.  Actual example:

original.png33k417x379px
normal_original.png175k399x363px
thumb_original.png15k99x90px


Details:
All original images are PNG.  Using ImageMagick.  Max dimension of intermediates set to 400px (but intermediates and thumbs always seem to be 1px less than max setting).  Using CPGmassimport.  Linux.


Thanks


Title: Re: huge file size for intermediate (normal_) images
Post by: Joachim Müller on December 17, 2007, 05:38:14 pm
Post real world examples, i.e. deep links to a set of files.
Title: Re: huge file size for intermediate (normal_) images
Post by: Nibbler on December 17, 2007, 05:57:02 pm
Did you adjust the quality setting in config?
Title: Re: huge file size for intermediate (normal_) images
Post by: rivers on December 17, 2007, 06:46:59 pm
Did you adjust the quality setting in config?

The menu and documentation specify that this option relates to "Quality for JPEG files", but my issue is with PNG files.  JPEG files are working perfectly under my install. 

But I tried this anyway.  Reduced quality from 80 to 75 and the intermediate file got even BIGGER (huge actually - like 7x the original PNG file size).

I tested with GD1 and PNG intermediates were created perfectly with small file sizes.  This seems to be an issue with ImageMagick,  so I will try to find solution on ImageMagick forums somewhere.  Probably some command line settings. 

Thanks again.  Will post if I can resolve.


p.s. Separate issue, but related:  I noticed that intermediates are not created if the setting "Max width or height of an intermediate picture/video" is greater than that of the original source file.  CPG would not create an intermediate with "Max width or height = 400px" if my PNG file was only 300x300px.  This behaviour was not documented anywhere I could find.  This was very confusing while trying to resolve the above ImageMagick problem. 








Title: Re: huge file size for intermediate (normal_) images
Post by: Nibbler on December 17, 2007, 07:07:16 pm
Check the IM manual for what quality means for PNG files.

http://www.imagemagick.org/script/command-line-options.php#quality
Title: Re: huge file size for intermediate (normal_) images
Post by: rivers on December 17, 2007, 08:25:00 pm
Check the IM manual for what quality means for PNG files.

http://www.imagemagick.org/script/command-line-options.php#quality


Thanks.  The appropriate compression settings made minimal difference, but the problem is largely solved with "-colors 256".  This greatly reduced the image sizes.

This brings up a problem though.  If I add thousands of JPEGs and PNGs simultaneously using CPGmassimport, when intermediates and thumbs are created using ImageMagick, the "JPEG Quality" setting in the Admin panel is applied in different ways to each file type.  If I want Quality=85 for JPEgs, I have to use that same setting for the PNGs as well, even though for PNGs it means a completely different thing.  And I only want the "-colors 256" switch applied to PNGs, not JPEgs.

Is there any better way of doing this?


Thanks
Title: Re: huge file size for intermediate (normal_) images
Post by: rivers on December 17, 2007, 08:27:48 pm

Oops, I think this solves it:

Mass import the PNG's and JPEGs in separate batches using different Quality and ImageMagick switches for each.

Thansk