[XeTeX] Wrong dimensions when using \XeTeXpicfile with CMYK image

Marcel Korpel marcel.lists at gmail.com
Mon Feb 9 00:43:42 CET 2015

A few days ago I posted a question at tex.stackexchange.com about a
wrong output of XeTeX and/or xdvipdfmx regarding jpeg images saved in
CMYK colours [0].

Consider the following example:

% The TeXbook, p. 311
  \hrule height#1 depth#2 \kern-#2 }
    \advance\dimen0 by#2\vrule width\dimen0}\kern-#2 }
    \kern-#1 % overlap the rules at the corners
    \hbox to \wd0{\hidevrule{#1}{#2}%
      \raise\ht0\vbox to #1{}% set the vrule height
      \lower\dp0\vtop to #1{}% set the vrule depth

\def\pic#1{\setbox0=\vbox{\XeTeXpicfile #1 width 8cm}


Please download the following files:

They are the same image saved in CMYK colours with an internal
resolution of 300 DPI, 72 DPI and with a resolution of 300 DPI in RGB
colours, respectively. You'll see that the 300 DPI CMYK image is set a
lot larger than the other ones, although a width of 8 cm is explicitly
given (also notice the boundaries of the \vbox). A CMYK image of 72
DPI is output exactly right, an image in a lower resolution is output
similarly smaller. I couldn't reproduce this issue with RGB pictures
[2]. Notice that all images are exactly 463x307 pixels large, *only*
the internal DPI setting differs.

At tex.stackexchange.com a moderator thinks it's a bug in xdvipdfmx.
If so, where to report it?

$ xetex --version
XeTeX 3.14159265-2.6-0.99991 (TeX Live 2014/Arch Linux)
kpathsea version 6.2.0
Copyright 2014 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 54.1; using 54.1
Compiled with zlib version 1.2.8; using 1.2.8
Compiled with FreeType2 version 2.5.5; using 2.4.12
Compiled with Graphite2 version 1.2.4; using 1.2.4
Compiled with HarfBuzz version 0.9.38; using 0.9.38
Compiled with libpng version 1.6.16; using 1.6.16
Compiled with poppler version 0.30.0
Compiled with fontconfig version 2.11.1; using 2.11.1

$ xdvipdfmx --version
This is xdvipdfmx Version 20140317 by Jonathan Kew and Jin-Hwan Cho,
modified for TeX Live […]


[1] Original question at
[2] If I recall correctly I've seen an image in RGB colours at a
resolution of 71.something DPI a bit smaller than the surrounding box,
exactly like its CMYK equivalent, but I wasn't able to reproduce this
behaviour again

More information about the XeTeX mailing list