Min reprex:
\documentclass{article}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{showframe} % just to illustrate
\begin{document}
\adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics{example-image}}%
\end{document}
The clip is essential to reproduce.
Potential clue:
I am trying to display a two-page picture. I am using the function from this answer.
When I use pdflatex the picture displays as I intend it to, immediately under the caption.
When I use XeLaTeX, however, it displays half-way down the page (for gull.jpg or is completely absent for example-image).
\documentclass[twoside,b5paper]{scrbook}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage[strict]{changepage}
\usepackage{afterpage,adjustbox}
\usepackage{caption}
\makeatletter
\newcommand{\twopagepicture}[4]{%
{\afterpage{%
\begin{figure}[#1]
\caption{#4}%
\makebox[\textwidth][l]{%
\let\mywidth\linewidth
\adjustbox{trim=0 0 {.5\width} 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\caption*{.}%
\end{figure}%
\begin{figure}[#1]
\caption*{\phantom{#4}}%
\makebox[\textwidth][l]{%
\let\mywidth\linewidth
\adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics[width=2\mywidth]{#3}}}%
\end{figure}%
}}%
}
\makeatother
\begin{document}
.
\twopagepicture{t}{l}{example-image}{Top caption}
\clearpage\clearpage
\includegraphics{example-image}
\end{document}
\listfiles
*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
graphics.sty 2016/05/09 v1.0r Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/01/02 v1.10 sample graphics configuration
xetex.def 2016/04/06 v4.08 LaTeX color/graphics driver for XeTeX (TeX Liv
e/RRM/JK)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
adjustbox.sty 2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
adjcalc.sty 2012/05/16 v1.1 Provides advanced setlength with multiple back-
ends (calc, etex, pgfmath)
trimclip.sty 2012/05/16 v1.0 Trim and clip general TeX material
collectbox.sty 2012/05/17 v0.4b Collect macro arguments as boxes
tc-xetex.def 2012/05/13 v1.0 Clipping driver for xetex
ifoddpage.sty 2016/04/23 v1.1 Conditionals for odd/even page detection
varwidth.sty 2009/03/30 ver 0.92; Variable-width minipages
showframe.sty 2011/02/24 v0.1i showframe (new impl., RN)
eso-pic.sty 2015/07/21 v2.0g eso-pic (RN)
atbegshi.sty 2016/05/16 v1.17 At begin shipout hook (HO)
ifpdf.sty 2016/05/14 v3.1 Provides the ifpdf switch
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
example-image.pdf Graphic file (type QTm)






example-image(a test file already in tex distributions) and without all the after page and float tests – David Carlisle Jun 17 '16 at 14:29example-imagedoesn't appear on the page when compiled usingxelatex. (In thegulland my particular example the image occurs about half-way down the page.) – Hugh Jun 17 '16 at 14:49gull.jpgandgull.eps)? If so, it may be that XeLaTeX is picking up a different file, which might have a different bounding box. – Nicola Talbot Jun 19 '16 at 17:11xetexandadjustbox2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)– Hugh Jun 22 '16 at 03:04