related question dimension-too-large-error-from-pdflatex-when-using-includegraphics

I have a normal looking small png file, which produces the same error as in the above question, but this is for png and not pdf and the image is small and verified

>file image3.png 
image3.png: PNG image data, 600 x 900, 8-bit/color RGBA, non-interlaced

>ls -l image3.png 
-rwxrwxrwx 1 me me 322135 Jul 11 15:11 image3.png

>convert image3.png -print "Size: %wx%h\n" /dev/null
Size: 600x900

When I compile it, I get

! Dimension too large.
<argument> \wd \@tempboxa 

l.6 ...udegraphics[width=0.95\linewidth]{image3.png}





>lualatex foo.tex 
This is LuaTeX, Version 0.95.0 (TeX Live 2016) 
 restricted system commands enabled.
LaTeX2e <2016/03/31> patch level 2
Babel <3.9r> and hyphenation patterns for 1 language(s) loaded.
Document Class: scrbook 2016/06/14 v3.21 KOMA-Script document class (book)
Package scrlfile, 2016/06/14 v3.21 KOMA-Script package (loading files)
                  Copyright (C) Markus Kohm

))) (/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/tocbasic.sty)
Package typearea, 2016/06/14 v3.21 KOMA-Script package (type area)
                  Copyright (C) Frank Neukam, 1992-1994
                  Copyright (C) Markus Kohm, 1994-

)) (/usr/local/texlive/2016/texmf-dist/tex/generic/luatex85/luatex85.sty)
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
! Dimension too large.
<argument> \wd \@tempboxa 

l.6 ...udegraphics[width=0.95\linewidth]{image3.png}


Same error with pdflatex.

The image3.png is in this folder

Mathematica graphics

Question is: Why Am I getting this error on this image? The image is just an image of a book cover, which display just fine with any image viewer program.

TL 2016


Thanks to comment, I used exiftool to check the image, here is the output

>exiftool image3.png 
ExifTool Version Number         : 9.46
File Name                       : image3.png
Directory                       : .
File Size                       : 315 kB
File Modification Date/Time     : 2016:07:11 15:11:18-05:00
File Access Date/Time           : 2016:07:11 15:28:49-05:00
File Inode Change Date/Time     : 2016:07:11 15:11:18-05:00
File Permissions                : rwxrwxrwx
File Type                       : PNG
MIME Type                       : image/png
Image Width                     : 600
Image Height                    : 900
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
SRGB Rendering                  : Perceptual
Gamma                           : 2.2
Pixels Per Unit X               : 78
Pixels Per Unit Y               : 78
Pixel Units                     : Meters
Image Size                      : 600x900

why does it say pixel units Meters in there?? This sounds little strange to me.

Here is a pic of the image

Mathematica graphics

  • Check if the image has a wrong DPI info. You should use some program like exiftool to check it. (Just a shot in the dark) – Rmano Jul 11 '16 at 21:07

I found the problem. Somehow the images has resolution 1.98 pixels per inch

Mathematica graphics

Opened it and saved it back using PAINT.NET as 300 pixels per inch

Mathematica graphics

And now the compile error went away.

So it looks like something was wrong in the image? I do not know how this happened.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.