# 'Dimension too large' error in animate package

I am using the animate package to include a series of images into a PDF (like a small movie), which usually works fine, however, now I am running into an

! Dimension too large.

l.5 ...\columnwidth]{4}{images/ani-}{00000}{00023}


error, which I cannot figure out or work around. The images are JPEG files, each 130x326 pixels large. The width and height given in the document should make them fit on the page neatly.

Here is the latex input file:

\documentclass[8pt]{beamer}
\usepackage{animate}
\begin{document}
\section{Image Slides}
\animategraphics[controls = false, autoplay, loop, height=0.18\columnwidth]{4}{images/ani-}{00000}{00023}
\end{document}


And here you can download the complete package with minimal latex file and the image frames (as JPEG): http://www.vivoquant.com/files/remove/Dimension-too-large.tgz

I of course already googled 'Dimension too large' and tried many of the workaround explained there, however, none worked for or applied to my case.

Any help is appreciated. Christian

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – barbara beeton Aug 1 '13 at 13:47
• If I change your MWE slightly to include the graphicx package and try to print one of your images, I get a similar error for the image, even with scale=0.01 or scale=0.001. The slide prints though... – darthbith Aug 1 '13 at 14:43

We have found the issue. The JPEG images were created with a new ImageMagick/libjpeg version, that apparently does not set the resolution/units in the JPEG Exif header properly:

$convert logo: x.jpg$ identify -verbose x.jpg | head
Image: x.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 640x480+0+0
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:


Working JPEG files show: Resolution: 72x72 Print size: 8.88889x6.66667 Units: PixelsPerInch

which can be achieved by explicity setting the density:

\$ convert logo: -density 72 x.jpg


Hope this helps other people trying to use the awesome animate package.