# [XeTeX] graphics aspect ratio

Wybo Dekker wybo at servalys.nl
Fri Feb 12 10:53:12 CET 2010

Wilfred van Rooijen wrote:

> If you are willing to send two example pictures and a minimal test file I can
> try to reproduce. It seems that the conversion with ImageMagick does
> something to the JPG to cause this behavior.

OK, I'll send you the the zip separately - it's 10 MB, too large for the list.
This is the test source:

\documentclass{article}
\usepackage{graphicx}
\usepackage{fontspec}
\parindent0pt
\begin{document}
\includegraphics[width=.5\hsize]{orig.jpg}\\
1: original

\includegraphics[width=.5\hsize]{qual40.jpg}\\
2: convert orig -quality 40 qual40.jpg
\end{document}

Remove the \usepackage{fontspec} and you can run it through pdflatex.
I have also added PostScript versions of the two jpegs. It appears that if you
remove the .jpg extensions in the source, xelatex uses the .ps files. These
produce the correct aspectratio, but produce a much larger pdf: 29 instead 6 MB

> Have you tried to convert with
> other software, like GIMP?

Yes, and that works OK, but the Gimp is not very handy for batch conversion of
hundreds of pictures...

--
Wybo