image inclusion on samba shares :-(
Hi, 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? Best Martin
Martin Schröder wrote:
Hi, 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?
i tested pdftex with - windows native disk - windows samba disk - linux and \starttext \externalfigure[CowCow.pdf] \externalfigure[Cowcow.pdf] \externalfigure[cowcow.pdf] \stoptext 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 Btw, in luatex, the image library is different from the pdftex one. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
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
Martin Schröder wrote:
Can we fix this in pdftex.def or must pdftex (and luatex) be changed?
btw, in general i think that pdftex should not crash or quit on a missing image or one that the xpdf library considers to be invalid; (better no image than an invalid file). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2008/11/4 Hans Hagen
Martin Schröder wrote:
Can we fix this in pdftex.def or must pdftex (and luatex) be changed?
btw, in general i think that pdftex should not crash or quit on a missing image or one that the xpdf library considers to be invalid; (better no image than an invalid file).
Agreed. Btw: empty images (e.g. a pdf with 0 bytes) also cause troubles. One problem is that the error handling in {pdf|lua}tex needs to be improved. Best Martin
Martin Schröder wrote:
2008/11/4 Hans Hagen
: Martin Schröder wrote:
Can we fix this in pdftex.def or must pdftex (and luatex) be changed? btw, in general i think that pdftex should not crash or quit on a missing image or one that the xpdf library considers to be invalid; (better no image than an invalid file).
Agreed. Btw: empty images (e.g. a pdf with 0 bytes) also cause troubles.
One problem is that the error handling in {pdf|lua}tex needs to be improved.
maybe the xpdf library should have some is_valid function? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, Nov 04, 2008 at 02:05:30PM +0100, Martin Schröder wrote:
2008/11/4 Hans Hagen
: Martin Schröder wrote:
Can we fix this in pdftex.def or must pdftex (and luatex) be changed?
btw, in general i think that pdftex should not crash or quit on a missing image or one that the xpdf library considers to be invalid; (better no image than an invalid file).
Agreed. Btw: empty images (e.g. a pdf with 0 bytes) also cause troubles.
I'll add a test for images with 0 bytes in pdftex.def if time permits.
Yours sincerely
Heiko
participants (3)
-
Hans Hagen
-
Heiko Oberdiek
-
Martin Schröder