\includegraphics command from
graphicx automatically tries different extensions for the figures. For the purpose of automatically processing latex files, I'd like to be able to emulate this behavior using the
kpathsea command, butthe options in the manual don't make it clear how to do this. Is it possible, or is there some other solution?
graphics doesn't do a "lookup with wildcard extension" it just loops through a known list of extensions and searches for each possibility in turn.
You can do the same on the commandline
$ for e in png eps pdf; do kpsewhich example-image.$e; done
/usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.png /usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.eps /usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.pdf
in my texlive 2014 setup, using a bash command line. Most other commandlines will offer a similar loop construct.