I am creating pdfs by including some random images from a large scale image database. The resolutions of images in this database are very different, so I can't change the resolution. Besides that, because of the layout restriction I can't use some existing solutions of similar question.

Note: you can download images here.

        \footnotesize\color{blue}  #1\\[-1ex]
        \footnotesize\color{blue}  #2\\
        row 1
                & \pic{1-13.jpg}
        row 2
&       \rdpic{1}{-0.4602}{1-13.jpg}
        row 3
        &       \rdpic{1}{-0.4602}{1-13.jpg}

enter image description here

  • 2
    Could you please show a minimal working example? – totera Jan 10 '17 at 10:49
  • 2
    99 times out of 100 the too large error comes from scaling after rotating the image to have zero height (so it is division by zero and infinitely large) the way to solve that is not to do it, can you show an example where you are getting this error on an actual finite calculation? – David Carlisle Jan 10 '17 at 10:51
  • @DavidCarlisle you are right, I saw rotated images when the error shows. But I did not do any rotation. Could you explain it? – neouyghur Jan 10 '17 at 11:35
  • @DavidCarlisle I offered images, could not you download it? – neouyghur Jan 10 '17 at 13:27
  • @neouyghur oh so you did, it would have been better to have cut the example down but sorry I just missed that link completely, I'll look – David Carlisle Jan 10 '17 at 13:28

really, the example is not at all minimal, it can easily be cut down to the following just by deleting things and checking the error still occurs




If you look at the log or terminal output you see

pdfTeX warning: pdflatex: arithmetic: number too big
<10-13.jpg, id=1, --32768.0pt x 0.0pt> <use 10-13.jpg>
! Dimension too large.

So before the graphics package arithmetic gave up with the ! Dimension too large pdftex had given up reading the natural size of the image and had underflowed its width to be showing as negative maxdimen. Given that starting width any attempt to scale the image to any size is going to fail in arbitrary ways.

There seems to be something odd in that file, if I just get imagemagic convert to re-write the jpg

mv 10-13.jpg x.jpg
convert x.jpg 10-13.jpg

Then pdftex reads it with no problem and shows:

<10-13.jpg, id=1, 718.685pt x 530.98375pt> <use 10-13.jpg> <use 10-13.jpg>

That is, it read the initial width as 718.685pt

  • you are right, it is the problem of these weird images. Thanks. – neouyghur Jan 10 '17 at 14:44
  • 1
    I encountered a similar issue with an image that had a dpi of 1. Increasing the dpi and re-exporting solved the issue. – Sussch Feb 4 '18 at 18:27

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.