Dimension too large. error from pdflatex when using includegraphics The Next CEO of Stack OverflowWhat's the absolute largest paper size permissible with pdflatex?Dimension too large for one imageHow to check that image has valid size before `includegraphics` is called?Dimension too large for small png image, error from epstopdf-sys.cfgDimensions too large + multiple picturesUndefined Control Sequence Error in PDFLatex with includegraphicsGot Error “! Missing $ inserted.” when using includegraphicsincludegraphics error when scaling imageUsing includegraphics makes pdf very largeGet rid of error when using includegraphics<2> ?How to check that image has valid size before `includegraphics` is called?Dimension too large for small png image, error from epstopdf-sys.cfghow to solve dimension too large error in includegraphics without changing resolutionpdfLatex vs Latex>DVI>PS>PDF for EPS, PDF, PNG images (Texstudio)Dimension too large for one image

Newlines in BSD sed vs gsed

Can you be charged for obstruction for refusing to answer questions?

What flight has the highest ratio of time difference to flight time?

Reference request: Grassmannian and Plucker coordinates in type B, C, D

Is it convenient to ask the journal's editor for two additional days to complete a review?

Is it professional to write unrelated content in an almost-empty email?

Prepend last line of stdin to entire stdin

Axiom Schema vs Axiom

Where does this common spurious transmission come from? Is there a quality difference?

RigExpert AA-35 - Interpreting The Information

Why didn't Khan get resurrected in the Genesis Explosion?

Why isn't the Mueller report being released completely and unredacted?

Can MTA send mail via a relay without being told so?

How many extra stops do monopods offer for tele photographs?

Find non-case sensitive string in a mixed list of elements?

How to prove a simple equation?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

How to count occurrences of text in a file?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Math-accent symbol over parentheses enclosing accented symbol (amsmath)

Proper way to express "He disappeared them"

Why do remote US companies require working in the US?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?



Dimension too large. error from pdflatex when using includegraphics



The Next CEO of Stack OverflowWhat's the absolute largest paper size permissible with pdflatex?Dimension too large for one imageHow to check that image has valid size before `includegraphics` is called?Dimension too large for small png image, error from epstopdf-sys.cfgDimensions too large + multiple picturesUndefined Control Sequence Error in PDFLatex with includegraphicsGot Error “! Missing $ inserted.” when using includegraphicsincludegraphics error when scaling imageUsing includegraphics makes pdf very largeGet rid of error when using includegraphics<2> ?How to check that image has valid size before `includegraphics` is called?Dimension too large for small png image, error from epstopdf-sys.cfghow to solve dimension too large error in includegraphics without changing resolutionpdfLatex vs Latex>DVI>PS>PDF for EPS, PDF, PNG images (Texstudio)Dimension too large for one image










15















I am getting the following error on few images being loaded by pdflatex. The images are in pdf files. MWE



documentclass[10pt,notitlepage]article
usepackagegraphicx
begindocument
includegraphics[width=textwidth,height=textheight,keepaspectratio]image
enddocument


pdflatex foo.tex gives



(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Dimension too large.
<argument> ht @tempboxa

l.7 ...,height=textheight,keepaspectratio]image

?


The image.pdf is this link



It doe not matter if the image size specification is there or not, the error still shows up. i.e. includegraphics[]image also generates the error.



The image pdf file has nothing in it. This is another issue. This image pdf file was created by Mathematica Export command. I was exporting a Mathematica image to pdf and it looks like Mathematica could not export the image to pdf file so it wrote an empty image pdf file. But the question is why pdflatex gives an error?



Is there a memory limit or some build in limit on size of pdf image files or dimensions?



I am using TL 2015 on linux mint 7.2



ps. Here is an example of pdf image file that is correctly read by pdflatex. It is not as large (and happened not to be empty as well).



Update:



fyi, Thanks to cfr comment in my other question How to check that image has valid size before `includegraphics` is called? , using pdfinfo -box image.pdf gives



>pdfinfo -box image.pdf
Creator: Wolfram Mathematica 10.1.0.0 for Microsoft Windows (64-bit) (March 23, 2015) Student Edition - Personal Use Only
Producer:
CreationDate: Tue Jul 21 13:15:48 2015
ModDate: Tue Jul 21 13:15:48 2015
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 504 x 18988 pts
Page rot: 0
MediaBox: 0.00 0.00 504.00 18988.00
CropBox: 0.00 0.00 504.00 18988.00
BleedBox: 0.00 0.00 504.00 18988.00
TrimBox: 0.00 0.00 504.00 18988.00
ArtBox: 0.00 0.00 504.00 18988.00
File size: 337034 bytes
Optimized: no
PDF version: 1.5
>









share|improve this question
























  • That's a really large image you're trying to include!

    – Gonzalo Medina
    Jul 26 '15 at 21:50











  • Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

    – Gonzalo Medina
    Jul 26 '15 at 21:53











  • @ChristianHupfer No; it's not a blank page; it's full of formulas and code.

    – Gonzalo Medina
    Jul 26 '15 at 21:55






  • 1





    It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

    – David Carlisle
    Jul 26 '15 at 22:04






  • 1





    @Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

    – David Carlisle
    Jul 26 '15 at 22:06















15















I am getting the following error on few images being loaded by pdflatex. The images are in pdf files. MWE



documentclass[10pt,notitlepage]article
usepackagegraphicx
begindocument
includegraphics[width=textwidth,height=textheight,keepaspectratio]image
enddocument


pdflatex foo.tex gives



(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Dimension too large.
<argument> ht @tempboxa

l.7 ...,height=textheight,keepaspectratio]image

?


The image.pdf is this link



It doe not matter if the image size specification is there or not, the error still shows up. i.e. includegraphics[]image also generates the error.



The image pdf file has nothing in it. This is another issue. This image pdf file was created by Mathematica Export command. I was exporting a Mathematica image to pdf and it looks like Mathematica could not export the image to pdf file so it wrote an empty image pdf file. But the question is why pdflatex gives an error?



Is there a memory limit or some build in limit on size of pdf image files or dimensions?



I am using TL 2015 on linux mint 7.2



ps. Here is an example of pdf image file that is correctly read by pdflatex. It is not as large (and happened not to be empty as well).



Update:



fyi, Thanks to cfr comment in my other question How to check that image has valid size before `includegraphics` is called? , using pdfinfo -box image.pdf gives



>pdfinfo -box image.pdf
Creator: Wolfram Mathematica 10.1.0.0 for Microsoft Windows (64-bit) (March 23, 2015) Student Edition - Personal Use Only
Producer:
CreationDate: Tue Jul 21 13:15:48 2015
ModDate: Tue Jul 21 13:15:48 2015
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 504 x 18988 pts
Page rot: 0
MediaBox: 0.00 0.00 504.00 18988.00
CropBox: 0.00 0.00 504.00 18988.00
BleedBox: 0.00 0.00 504.00 18988.00
TrimBox: 0.00 0.00 504.00 18988.00
ArtBox: 0.00 0.00 504.00 18988.00
File size: 337034 bytes
Optimized: no
PDF version: 1.5
>









share|improve this question
























  • That's a really large image you're trying to include!

    – Gonzalo Medina
    Jul 26 '15 at 21:50











  • Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

    – Gonzalo Medina
    Jul 26 '15 at 21:53











  • @ChristianHupfer No; it's not a blank page; it's full of formulas and code.

    – Gonzalo Medina
    Jul 26 '15 at 21:55






  • 1





    It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

    – David Carlisle
    Jul 26 '15 at 22:04






  • 1





    @Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

    – David Carlisle
    Jul 26 '15 at 22:06













15












15








15








I am getting the following error on few images being loaded by pdflatex. The images are in pdf files. MWE



documentclass[10pt,notitlepage]article
usepackagegraphicx
begindocument
includegraphics[width=textwidth,height=textheight,keepaspectratio]image
enddocument


pdflatex foo.tex gives



(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Dimension too large.
<argument> ht @tempboxa

l.7 ...,height=textheight,keepaspectratio]image

?


The image.pdf is this link



It doe not matter if the image size specification is there or not, the error still shows up. i.e. includegraphics[]image also generates the error.



The image pdf file has nothing in it. This is another issue. This image pdf file was created by Mathematica Export command. I was exporting a Mathematica image to pdf and it looks like Mathematica could not export the image to pdf file so it wrote an empty image pdf file. But the question is why pdflatex gives an error?



Is there a memory limit or some build in limit on size of pdf image files or dimensions?



I am using TL 2015 on linux mint 7.2



ps. Here is an example of pdf image file that is correctly read by pdflatex. It is not as large (and happened not to be empty as well).



Update:



fyi, Thanks to cfr comment in my other question How to check that image has valid size before `includegraphics` is called? , using pdfinfo -box image.pdf gives



>pdfinfo -box image.pdf
Creator: Wolfram Mathematica 10.1.0.0 for Microsoft Windows (64-bit) (March 23, 2015) Student Edition - Personal Use Only
Producer:
CreationDate: Tue Jul 21 13:15:48 2015
ModDate: Tue Jul 21 13:15:48 2015
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 504 x 18988 pts
Page rot: 0
MediaBox: 0.00 0.00 504.00 18988.00
CropBox: 0.00 0.00 504.00 18988.00
BleedBox: 0.00 0.00 504.00 18988.00
TrimBox: 0.00 0.00 504.00 18988.00
ArtBox: 0.00 0.00 504.00 18988.00
File size: 337034 bytes
Optimized: no
PDF version: 1.5
>









share|improve this question
















I am getting the following error on few images being loaded by pdflatex. The images are in pdf files. MWE



documentclass[10pt,notitlepage]article
usepackagegraphicx
begindocument
includegraphics[width=textwidth,height=textheight,keepaspectratio]image
enddocument


pdflatex foo.tex gives



(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Dimension too large.
<argument> ht @tempboxa

l.7 ...,height=textheight,keepaspectratio]image

?


The image.pdf is this link



It doe not matter if the image size specification is there or not, the error still shows up. i.e. includegraphics[]image also generates the error.



The image pdf file has nothing in it. This is another issue. This image pdf file was created by Mathematica Export command. I was exporting a Mathematica image to pdf and it looks like Mathematica could not export the image to pdf file so it wrote an empty image pdf file. But the question is why pdflatex gives an error?



Is there a memory limit or some build in limit on size of pdf image files or dimensions?



I am using TL 2015 on linux mint 7.2



ps. Here is an example of pdf image file that is correctly read by pdflatex. It is not as large (and happened not to be empty as well).



Update:



fyi, Thanks to cfr comment in my other question How to check that image has valid size before `includegraphics` is called? , using pdfinfo -box image.pdf gives



>pdfinfo -box image.pdf
Creator: Wolfram Mathematica 10.1.0.0 for Microsoft Windows (64-bit) (March 23, 2015) Student Edition - Personal Use Only
Producer:
CreationDate: Tue Jul 21 13:15:48 2015
ModDate: Tue Jul 21 13:15:48 2015
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 504 x 18988 pts
Page rot: 0
MediaBox: 0.00 0.00 504.00 18988.00
CropBox: 0.00 0.00 504.00 18988.00
BleedBox: 0.00 0.00 504.00 18988.00
TrimBox: 0.00 0.00 504.00 18988.00
ArtBox: 0.00 0.00 504.00 18988.00
File size: 337034 bytes
Optimized: no
PDF version: 1.5
>






graphics






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:35









Community

1




1










asked Jul 26 '15 at 21:41









NasserNasser

8,32873189




8,32873189












  • That's a really large image you're trying to include!

    – Gonzalo Medina
    Jul 26 '15 at 21:50











  • Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

    – Gonzalo Medina
    Jul 26 '15 at 21:53











  • @ChristianHupfer No; it's not a blank page; it's full of formulas and code.

    – Gonzalo Medina
    Jul 26 '15 at 21:55






  • 1





    It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

    – David Carlisle
    Jul 26 '15 at 22:04






  • 1





    @Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

    – David Carlisle
    Jul 26 '15 at 22:06

















  • That's a really large image you're trying to include!

    – Gonzalo Medina
    Jul 26 '15 at 21:50











  • Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

    – Gonzalo Medina
    Jul 26 '15 at 21:53











  • @ChristianHupfer No; it's not a blank page; it's full of formulas and code.

    – Gonzalo Medina
    Jul 26 '15 at 21:55






  • 1





    It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

    – David Carlisle
    Jul 26 '15 at 22:04






  • 1





    @Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

    – David Carlisle
    Jul 26 '15 at 22:06
















That's a really large image you're trying to include!

– Gonzalo Medina
Jul 26 '15 at 21:50





That's a really large image you're trying to include!

– Gonzalo Medina
Jul 26 '15 at 21:50













Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

– Gonzalo Medina
Jul 26 '15 at 21:53





Your image reports as being 7x263.722 in! So the height is nearly 6.7 meters!

– Gonzalo Medina
Jul 26 '15 at 21:53













@ChristianHupfer No; it's not a blank page; it's full of formulas and code.

– Gonzalo Medina
Jul 26 '15 at 21:55





@ChristianHupfer No; it's not a blank page; it's full of formulas and code.

– Gonzalo Medina
Jul 26 '15 at 21:55




1




1





It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

– David Carlisle
Jul 26 '15 at 22:04





It's very big and acrobat says it has invalid ids internally. You can probably load it into something else then save at half size or less, although it's not going to be readable when scale into the a4 page anyway.

– David Carlisle
Jul 26 '15 at 22:04




1




1





@Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

– David Carlisle
Jul 26 '15 at 22:06





@Nasser the limit is not related to images it is a limit on tex dimensions. You can not have a length bigger than maxdimen

– David Carlisle
Jul 26 '15 at 22:06










3 Answers
3






active

oldest

votes


















14














There's a limit for graphics dimensions, bounded above by maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example,



documentclassarticle
usepackagegraphicx

begindocument

includegraphics[height=576cm,width=2cm]example-image-a

enddocument


triggers the error message, but using 575 there's no error (just the obvious warning about overfull vbox)



Your image is almost 670cm high! (clearly higher than maxdimen) so the error is triggered. Besides that, what would you do with such a large image compressed to fit into an a4paper document?






share|improve this answer

























  • Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

    – Nasser
    Jul 26 '15 at 22:08












  • Open the image in your viewer and check the "Properties" section.

    – Gonzalo Medina
    Jul 26 '15 at 22:09






  • 1





    These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

    – Nasser
    Jul 26 '15 at 22:38






  • 1





    Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

    – cfr
    Jul 26 '15 at 22:53






  • 1





    The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

    – Nasser
    Jul 26 '15 at 23:35


















2














Another issue that seems to cause this problem is if the image is in CMYK colorspace (even if the dimensions are below the max limit). To fix this, you can re-save it as an RGB image using Photoshop or another image editing tool, or convert it directly using one of the many converters online such as http://www.cmykconverter.com/



This occurred with XeLateX on the Overleaf platform.






share|improve this answer























  • I had the same problem but I used cmyk2rgb.com to convert the image

    – Samantha Catania
    Jan 27 at 12:46


















0














This may happen also if the image has sane size, but has declared incorrect DPI set (for example 800x600 pixels image, but with 2x2 DPI set... which makes it 1000 cm wide).



You can correct the DPI in an image editor (well, if it is not a PDF file), and it should work fine.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f257153%2fdimension-too-large-error-from-pdflatex-when-using-includegraphics%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    14














    There's a limit for graphics dimensions, bounded above by maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example,



    documentclassarticle
    usepackagegraphicx

    begindocument

    includegraphics[height=576cm,width=2cm]example-image-a

    enddocument


    triggers the error message, but using 575 there's no error (just the obvious warning about overfull vbox)



    Your image is almost 670cm high! (clearly higher than maxdimen) so the error is triggered. Besides that, what would you do with such a large image compressed to fit into an a4paper document?






    share|improve this answer

























    • Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

      – Nasser
      Jul 26 '15 at 22:08












    • Open the image in your viewer and check the "Properties" section.

      – Gonzalo Medina
      Jul 26 '15 at 22:09






    • 1





      These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

      – Nasser
      Jul 26 '15 at 22:38






    • 1





      Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

      – cfr
      Jul 26 '15 at 22:53






    • 1





      The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

      – Nasser
      Jul 26 '15 at 23:35















    14














    There's a limit for graphics dimensions, bounded above by maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example,



    documentclassarticle
    usepackagegraphicx

    begindocument

    includegraphics[height=576cm,width=2cm]example-image-a

    enddocument


    triggers the error message, but using 575 there's no error (just the obvious warning about overfull vbox)



    Your image is almost 670cm high! (clearly higher than maxdimen) so the error is triggered. Besides that, what would you do with such a large image compressed to fit into an a4paper document?






    share|improve this answer

























    • Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

      – Nasser
      Jul 26 '15 at 22:08












    • Open the image in your viewer and check the "Properties" section.

      – Gonzalo Medina
      Jul 26 '15 at 22:09






    • 1





      These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

      – Nasser
      Jul 26 '15 at 22:38






    • 1





      Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

      – cfr
      Jul 26 '15 at 22:53






    • 1





      The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

      – Nasser
      Jul 26 '15 at 23:35













    14












    14








    14







    There's a limit for graphics dimensions, bounded above by maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example,



    documentclassarticle
    usepackagegraphicx

    begindocument

    includegraphics[height=576cm,width=2cm]example-image-a

    enddocument


    triggers the error message, but using 575 there's no error (just the obvious warning about overfull vbox)



    Your image is almost 670cm high! (clearly higher than maxdimen) so the error is triggered. Besides that, what would you do with such a large image compressed to fit into an a4paper document?






    share|improve this answer















    There's a limit for graphics dimensions, bounded above by maxdimen (16384pt); in the case of the height for images, the limit is around 574cm to 576cm for some of the images I tested. For example,



    documentclassarticle
    usepackagegraphicx

    begindocument

    includegraphics[height=576cm,width=2cm]example-image-a

    enddocument


    triggers the error message, but using 575 there's no error (just the obvious warning about overfull vbox)



    Your image is almost 670cm high! (clearly higher than maxdimen) so the error is triggered. Besides that, what would you do with such a large image compressed to fit into an a4paper document?







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 26 '15 at 22:17

























    answered Jul 26 '15 at 22:00









    Gonzalo MedinaGonzalo Medina

    402k4113151580




    402k4113151580












    • Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

      – Nasser
      Jul 26 '15 at 22:08












    • Open the image in your viewer and check the "Properties" section.

      – Gonzalo Medina
      Jul 26 '15 at 22:09






    • 1





      These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

      – Nasser
      Jul 26 '15 at 22:38






    • 1





      Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

      – cfr
      Jul 26 '15 at 22:53






    • 1





      The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

      – Nasser
      Jul 26 '15 at 23:35

















    • Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

      – Nasser
      Jul 26 '15 at 22:08












    • Open the image in your viewer and check the "Properties" section.

      – Gonzalo Medina
      Jul 26 '15 at 22:09






    • 1





      These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

      – Nasser
      Jul 26 '15 at 22:38






    • 1





      Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

      – cfr
      Jul 26 '15 at 22:53






    • 1





      The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

      – Nasser
      Jul 26 '15 at 23:35
















    Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

    – Nasser
    Jul 26 '15 at 22:08






    Thanks. Is there a way to check for this in Latex before loading the image? I have thousands of such images, generated automatically and I do not know what size they will come out as. I need a way to check then if the image is too large and not include, else the build will fail. Most the images are small, but few, due to the computation, can show up this large.

    – Nasser
    Jul 26 '15 at 22:08














    Open the image in your viewer and check the "Properties" section.

    – Gonzalo Medina
    Jul 26 '15 at 22:09





    Open the image in your viewer and check the "Properties" section.

    – Gonzalo Medina
    Jul 26 '15 at 22:09




    1




    1





    These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

    – Nasser
    Jul 26 '15 at 22:38





    These are Mathematica graphics, exported to pdf using Mathematica Export. From design point of view, it is better to have the program trying to load the pdf to check if it can do it not, than trying to figure how to make Mathematica only export pdf files that Latex can load. May be later I want to use these pdf files by another program than can read them? Also it is hard to map Mathematica graphics sizes to what will show up as in pdf after export.

    – Nasser
    Jul 26 '15 at 22:38




    1




    1





    Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

    – cfr
    Jul 26 '15 at 22:53





    Well it obviously does care or it wouldn't go bananas when @Nasser does! Indeed, if it cared less, there wouldn't be a problem... ;).

    – cfr
    Jul 26 '15 at 22:53




    1




    1





    The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

    – Nasser
    Jul 26 '15 at 23:35





    The issue not for latex to "correct" anything. The issue is to provide the means for the user to check if they want to load the image or not. This is called defensive programming. I should be able to write a Latex document that handle any size images by adding checks. If the image is too large, I will not load it. Now my Latex document is robust and will compile all the time. I can replace the image by a message saying image too large to include. Any way, I opened new question on this topic so this discussion may be belong to there.

    – Nasser
    Jul 26 '15 at 23:35











    2














    Another issue that seems to cause this problem is if the image is in CMYK colorspace (even if the dimensions are below the max limit). To fix this, you can re-save it as an RGB image using Photoshop or another image editing tool, or convert it directly using one of the many converters online such as http://www.cmykconverter.com/



    This occurred with XeLateX on the Overleaf platform.






    share|improve this answer























    • I had the same problem but I used cmyk2rgb.com to convert the image

      – Samantha Catania
      Jan 27 at 12:46















    2














    Another issue that seems to cause this problem is if the image is in CMYK colorspace (even if the dimensions are below the max limit). To fix this, you can re-save it as an RGB image using Photoshop or another image editing tool, or convert it directly using one of the many converters online such as http://www.cmykconverter.com/



    This occurred with XeLateX on the Overleaf platform.






    share|improve this answer























    • I had the same problem but I used cmyk2rgb.com to convert the image

      – Samantha Catania
      Jan 27 at 12:46













    2












    2








    2







    Another issue that seems to cause this problem is if the image is in CMYK colorspace (even if the dimensions are below the max limit). To fix this, you can re-save it as an RGB image using Photoshop or another image editing tool, or convert it directly using one of the many converters online such as http://www.cmykconverter.com/



    This occurred with XeLateX on the Overleaf platform.






    share|improve this answer













    Another issue that seems to cause this problem is if the image is in CMYK colorspace (even if the dimensions are below the max limit). To fix this, you can re-save it as an RGB image using Photoshop or another image editing tool, or convert it directly using one of the many converters online such as http://www.cmykconverter.com/



    This occurred with XeLateX on the Overleaf platform.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 24 '17 at 13:41









    MaxMax

    1211




    1211












    • I had the same problem but I used cmyk2rgb.com to convert the image

      – Samantha Catania
      Jan 27 at 12:46

















    • I had the same problem but I used cmyk2rgb.com to convert the image

      – Samantha Catania
      Jan 27 at 12:46
















    I had the same problem but I used cmyk2rgb.com to convert the image

    – Samantha Catania
    Jan 27 at 12:46





    I had the same problem but I used cmyk2rgb.com to convert the image

    – Samantha Catania
    Jan 27 at 12:46











    0














    This may happen also if the image has sane size, but has declared incorrect DPI set (for example 800x600 pixels image, but with 2x2 DPI set... which makes it 1000 cm wide).



    You can correct the DPI in an image editor (well, if it is not a PDF file), and it should work fine.






    share|improve this answer



























      0














      This may happen also if the image has sane size, but has declared incorrect DPI set (for example 800x600 pixels image, but with 2x2 DPI set... which makes it 1000 cm wide).



      You can correct the DPI in an image editor (well, if it is not a PDF file), and it should work fine.






      share|improve this answer

























        0












        0








        0







        This may happen also if the image has sane size, but has declared incorrect DPI set (for example 800x600 pixels image, but with 2x2 DPI set... which makes it 1000 cm wide).



        You can correct the DPI in an image editor (well, if it is not a PDF file), and it should work fine.






        share|improve this answer













        This may happen also if the image has sane size, but has declared incorrect DPI set (for example 800x600 pixels image, but with 2x2 DPI set... which makes it 1000 cm wide).



        You can correct the DPI in an image editor (well, if it is not a PDF file), and it should work fine.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 7 hours ago









        Jakub NarębskiJakub Narębski

        670717




        670717



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f257153%2fdimension-too-large-error-from-pdflatex-when-using-includegraphics%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Styletc

            Tórshavn Kliima | Partnerstääden | Luke uk diar | Nawigatsjuun62° 1′ N, 6° 46′ W62° 1′ 0″ N, 6° 46′ 0″ WWMOTórshavn