[NTG-pdftex] image inclusion on samba shares :-(

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue Nov 4 18:01:49 CET 2008

On Tue, Nov 04, 2008 at 01:43:34PM +0100, Hans Hagen wrote:

> Martin Schröder wrote:

> > we're having problems with image inclusion on samba shares: the
> > case-(in)sensitivity of pdftex/LaTeX differs in places.
> > 
> > The setup is a Linux vm mounting a samba share from a Linux server.
> > 
> > We do an \includegraphics with a filename that differs in case from
> > the file on the server (say "Foo.jpg" instead of "foo.jpg"). Since the
> > samba mount is per default case-insensitive, we can see (e.g. with
> > "ls") the file on the client. But pdftex exits with "pdflatex:
> > Foo.jpg: No such file or directory", which is not written to the
> > logfile, and we end up with an empty or corrupt pdf.
> > 
> > The image inclusion in pdftex.def first checks if the file exists;
> > apparently this works, although the later image inclusion fails. And
> > the image inclusion fails so horribly that pdftex has no chance to
> > clean up after itself (it simly exits in xfopen).
> > 
> > Can we fix this in pdftex.def or must pdftex (and luatex) be changed?

> with files being there or not and i cannot get pdftex to crash so i 
> guess that there might be some problem in pdftex.def then

pdftex.def uses \pdffilesize for the existence check. \openin cannot
be used, because pdftex.def supports spaces in file names.
Then the image is included using \pdfximage.

\pdffilesize uses kpse_find_tex, see utils.c, that is a macro for
  kpse_find_file(..., kpse_tex_format, true).
\pdfximage uses kpse_find_file(..., kpse_tex_format, true),
see readimage in writeimg.c.

If the file does not exist, \pdffilesize is to be supposed to return
nothing, otherwise it expands to the file size.

I don't see, why case-insensitivity should matter here.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>

More information about the ntg-pdftex mailing list