# Dimension too large for one image

I want to include one image (G0004.jpg) and I got the following error:

D:\Documents\HEIA\Physique\Analyse_spectrale\temp.tex:16: Dimension too large. [...cs[width=0.95\textwidth]{images/G0004.jpg}]
D:\Documents\HEIA\Physique\Analyse_spectrale\temp.tex:16: Dimension too large. [...cs[width=0.95\textwidth]{images/G0004.jpg}]

\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{geometry} \geometry{ a4paper, margin=2.5cm }
\usepackage[utf8]{inputenc}
\usepackage[francais]{babel}
\usepackage[squaren,Gray]{SIunits}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{tabularx}
\usepackage {array}
\graphicspath{ {images/} }
\begin{document}
\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\textwidth]{images/G0004.jpg}
\caption{caption}
\label{fig:label}
\end{figure}
\end{document}


• Your image is probably too large, you should reduce with some external tool. See also tex.stackexchange.com/questions/257153/… – Ulrike Fischer May 5 '17 at 8:33
• I can't reproduce the problem with your uploaded image. – Bobyandbob May 5 '17 at 8:36
• My image is 700x600 px. I if y try with another one, i dont have the error. – Warok May 5 '17 at 8:38
• @Warok This is exactly the one i used(700x600 px see). It works. Try to move the image in the same folder. – Bobyandbob May 5 '17 at 8:42
• Uploaded images inserted here in the questions are not the originals graphics. You would have to put it to some upload service if someone should inspect it. Perhaps it has some faulty resolution. – Ulrike Fischer May 5 '17 at 8:47

\includegraphics[width=0.95\textwidth]{images/G0004.jpg}


you should try

\includegraphics[width=\textwidth, height=0.9\textheight,
keepaspectratio]{images/G0004.jpg}


Since the figure environment contains a caption but (apparently) no legend, it should suffice to set aside about 0.1\textheight to place the caption material.

Incidentally, since the float is almost certainly going to occupy an entire page, you might as well replace \begin{figure}[htbp] with \begin{figure}[p]. If nothing else, there'll be less code clutter.

• That's a good suggestion, but the example image is in landscape format (W:H = 700:600) and the paper is A4 (portrait) so this should not be the problem here. – Schweinebacke May 5 '17 at 9:54
• @Schweinebacke - Thanks. Let's see if the OP provides more information about the natural dimensions of the file G0004.jpg. – Mico May 5 '17 at 10:31