[pdftex] graphic{s,x} PNG + pdflatex bug

Thanh Han The thanh at river-valley.org
Fri May 7 22:08:21 CEST 2010


On 5/7/10, George N. White III <gnwiii at gmail.com> wrote:
> On Thu, May 6, 2010 at 2:41 PM, Martin Heller <mr_heller at yahoo.dk> wrote:
>
> > On 2010-05-06 16:31, Nico Schlömer wrote:
>  >>
>  >> Hi all,
>  >>
>  >> I experienced a weird bug using \includegraphics of the graphicx
>  >> package with pdflatex 1.40.10.
>  >>
>  >> I try to load the attached PNG file, and unlike with other PNG files,
>  >> pdflatex would just bail out with
>  >>
>  >> ==================== *snip* ====================
>  >> [...]
>  >> [Loading MPS to PDF converter (version 2006.09.02).]
>  >> )
>  >> ! Dimension too large.
>  >> <argument>  \wd \@tempboxa
>  >> l.7 \includegraphics{img1.png}
>  >> ?
>  >> ==================== *snap* ====================
>  >>
>  >> David Carlisle, maintainer of graphicx, suggests that may be a bug in
>  >> pdflatex -- What do you reckon?
>
>
> Actually, the "! Dimension too large" is accurate here.
>
>
>  > Your image has a rather odd resolution.
>  >
>  > Image: img1.png
>  >  Format: PNG (Portable Network Graphics)
>  >  Class: DirectClass
>  >  Geometry: 250x250+0+0
>  >  Resolution: 0.39x0.39
>  >  Print size: 641.026x641.026
>  >  Units: PixelsPerInch
>  >
>  > So your png is 250/0.39 = 641.026 in wide.
>  >
>  > That is 46153 pt which is larger than \maxdimen. Change the resolution and
>  > your image works fine with \includegraphics.
>
>
> Saving with Photoshop doesn't affect the above values, but does add
>  PNG VirtualPage Tags (vpAg in pngcheck):
>
>  Index   Tag Name
>  0       VirtualImageWidth
>  1       VirtualImageHeight
>  2       VirtualPageUnits
>
>  Since the Photoshopped image works, it seems that pdftex uses
>  the vpAg values when present in preference to the pixel sizes.

pdftex uses libpng to read png files and relies on what libpng
returns.

Thanh



More information about the pdftex mailing list