Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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}
share|improve this question
add comment

marked as duplicate by Martin Schröder, T. Verron, Guido, Claudio Fiandrino, m0nhawk Jun 29 '13 at 11:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 7 down vote accepted
\usepackage[draft]{graphicx}

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

share|improve this answer
    
Perfect, thank you very much –  David Jun 28 '13 at 11:32
add comment

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
share|improve this answer
    
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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.