I know how to check if a given argument represents an existing file (see this question).
But is there also a possibility to check if this file can be included by \includegraphics
?
What I want to achieve is a command that
- includes an image (and does some more things) if it can, but
- includes some kind of info box and adds an entry to a 'list of missing images' if the argument doesn't point to a (existing and valid) image file.
Best Answer
Second attempt
This here should do the same tests than
\includegraphics
. That means if will give yes if the graphics/file exists and if the extension can be handled be the engine (sotiger.eps
will give different results withpdflatex
andlatex
: (The code is from the definition of\Ginclude@graphics
in graphics.sty).