pdftex.def and luatex.def have been updated at CTAN and so will get updates in texlive/miktex shortly.
Please see https://github.com/latex3/graphics-def/issues/38 and associated PR
I actually set things up slightly differently to the suggestion below. The files now always include epstopdf-base even with --no-shell-escape . This give better compatibility with the default processing, and does have the required properties of giving an error if no conversion is possible and including a pre-converted pdf if it exists (eg if the document has previously been run with the default restricted shell escape).
Original Answer
I think the logic in pdftex.def can be improved adding something like the block here
\documentclass{article} \usepackage{graphicx} \makeatletter \ifnum\pdfshellescape=0 \expanded{\def\noexpand\Gin@epstopdf@aux#1.\detokenize{eps}}.#2\relax{#1-eps-converted-to.pdf} \def\Ginclude@eps#1{% \expanded{\edef\noexpand\Gin@tempa{\noexpand\noexpand\noexpand\Gin@epstopdf@aux#1.\detokenize{eps}\relax}}% \edef\Gin@tempa{\Gin@tempa}% \IfFileExists{\Gin@tempa}% {\Ginclude@pdf{\Gin@tempa}}% {\PackageError{Graphics} {No PDF version of #1 available}% {Shell escape conversion has been disabled}}% } \fi \makeatother \begin{document} \includegraphics{ex1.eps} \includegraphics{ex2.eps} \end{document}
This means that if (from a previous run or made externally) ex1-eps-converted-to.pdf exists, it gets used, if it does not you get
! Package Graphics Error: No PDF version of ex2.eps available. See the Graphics package documentation for explanation. Type H <return> for immediate help. ... l.24 \includegraphics{ex2.eps} ? h Shell escape conversion has been disabled ?
MWEgraphics.styunconditionally defines\Gread@epsandpdftex.defnever defines\Ginclude@eps, so the test atgraphics.sty:276-282will always enable draft mode and produce no error. Andpdftex.defunconditionally defines\Gin@[email protected], so the test atgraphics.sty:244-251doesn't produce an error. And with shell escape disabled,pdftex.def:673-696never loadsepstopdf-base.sty(which is what would actually convert the EPS file). So it looks like a bug to me?\ifnum\pdfshellescape=0 \expandafter\let\csname Gread@eps\endcsname\undefined \fishould "fix" the problem, but this seems like a bug that should be fixed ingraphics/xto me.Gread@eps(probably) as that's used for reading .bb files as well, also if the -converted-to file is already there from a previous run it should all work without shell escape.