[Tex/LaTex] Dimension too large for one image

graphics

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}

My picture
Thx for your help

Best Answer

Instead of

\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.