1

When I compile a large document with many images, this compilation is very slow. Exist any method that allow read ONLY (no rendering) the width and height of imagen and then simulate this image with a dummy rule. For example:

\newdimen\onlyWidth
\newdimen\onlyHeight

\setlenght{\onlyWidth}{\readOnlyWidth{\path\of\image.jpg}}  
\setlenght{\onlyHeight}{\readOnlyHeight{\path\of\image.jpg}}  

\begin{figure}[t]
    \rule{\onlyWidth}{\onlyHeight}
    \caption{any}
\end{figure}
David
  • 591

2 Answers2

8
\usepackage[draft]{graphicx}

still reads the files to determine size info but just typesets a rule.

David Carlisle
  • 757,742
1

If you are using \includegraphics you can try to use the [draft] option in this way \includegraphics[draft]{image.jpg}. This will improve the time of compilation but I don't know if it is sufficient.

Or you can use something like this

\usepackage{calc}
\def\mygraphic{\includegraphics{...}}

\newlength\imageheight
\setlength\imageheight{\heightof{\mygraphic}}

\mygraphic % to insert the image

\vspace{\graphicheight} % a blank space of the height of your image
Red
  • 10,181
  • The vspace won't make the same space as the graphic as it is a vertical mode command whereas \includegraphics is a horizontal mode thing so would start a paragraph and get \parskip or \baselineskip spacing in addition to its natural height. You could use \rule instead of \vspace but that is the same (but less efficient) as using draft. – David Carlisle Jun 28 '13 at 11:31