[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphicsmagick-help
Subject:    Re: [GM-help] GM doesn't recognize filesize of PDF correctly
From:       Bob Friesenhahn <bfriesen () simple ! dallas ! tx ! us>
Date:       2011-12-22 15:33:33
Message-ID: alpine.GSO.2.01.1112220918320.1952 () freddy ! simplesystems ! org
[Download RAW message or body]

On Thu, 22 Dec 2011, Peter Kühnlein wrote:

> Good morning List,
> 
> I have a Typo3-installation running that recently was moved to an Ubuntu server. \
> Typo3 in this intallation uses Graphicsmagick to render images on websites. Since \
> the installation was moved, neither PDF nor AI images are converted anymore. I \
> found that Graphicsmagick fails to recognize the filesizes of PDFs and AIs (they \
> are mistakenly identified as being 100k times larger than they really are, e.g., \
> 1.2MB instead of 14kB), but correctly identifies the filesizes of JPGs, TGAs etc. \
> This is probably the source of the above mentioned conversion problem. 
> Does anyone happen to know this strange effect? Is this a known bug? (I found \
> nothing in the bug tracker though.)

A bit of experimentation here reveals that neither ImageMagick or 
GraphicsMagick is reporting the size of the original input file. 
Both are reporting the size of the temporary file returned by 
Ghostscript.  However, it seems that ImageMagick's identify (without 
-verbose) must be requesting that Ghostscript return a bilevel 
(black/white) version of the PDF page whereas GraphicsMagick requests 
a PNM intermediate format (PPM) which supports color.  Bilevel formats 
are much smaller than color which is why IM reports the smaller file 
size.

Adding the -verbose flag to IM's identify produces entirely different 
results than without -verbose since it is passing different options to 
Ghostscript.  For a color PDF, IM's identify reports the color page as 
bilevel, but with -verbose added, it reports that it is a color page.

It is quite likely that Typo3 requests only the first PDF page like 
'infile.pdf[0]' so a true reporting of the input file size (the size 
of the requested page) should first somehow extract that one PDF page 
as PDF with a minimum of translation.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

_______________________________________________
Graphicsmagick-help mailing list
Graphicsmagick-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic