Hi, It's kind of annoying that pdftex has hard coded suffixes. how about something \pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf} 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 Mon, 28 Aug 2006, Hans Hagen wrote:
It's kind of annoying that pdftex has hard coded suffixes.
how about something
\pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf}
but you know that the suffixes are used only as a last resort, as first the file headers are checked for the file type (thanks to Heiko!). So e. g. foo.somejpg is a legal name and would still be recognized as .png if it's a png file :-) Regards, Hartmut
Hartmut Henkel wrote:
On Mon, 28 Aug 2006, Hans Hagen wrote:
It's kind of annoying that pdftex has hard coded suffixes.
how about something
\pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf}
but you know that the suffixes are used only as a last resort, as first the file headers are checked for the file type (thanks to Heiko!). So e. g. foo.somejpg is a legal name and would still be recognized as .png if it's a png file :-)
ah, i thought so but got an error; i see now that i was testing a faulty graphic sorry for the noice (btw, is there already a better jb2 commandline tool?) 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 -----------------------------------------------------------------
Hartmut Henkel wrote:
On Mon, 28 Aug 2006, Hans Hagen wrote:
It's kind of annoying that pdftex has hard coded suffixes.
how about something
\pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf}
but you know that the suffixes are used only as a last resort, as first the file headers are checked for the file type (thanks to Heiko!). So e. g. foo.somejpg is a legal name and would still be recognized as .png if it's a png file :-)
when i test with a unknown format, i get an abort and: Error: pdftex.exe (file ./hakker1b.tif): unknown type of image so, in order to know if a funny suffix is a valid one for pdftex, we need something \pdfcheckimage{somefile.somesiffix} which sets a flag, say \pdfimagecheck 0/1 otherwise there is no way to intercept errors ----------------------------------------------------------------- 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 Mon, 28 Aug 2006, Hans Hagen wrote:
Hartmut Henkel wrote:
On Mon, 28 Aug 2006, Hans Hagen wrote:
It's kind of annoying that pdftex has hard coded suffixes.
how about something
\pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf}
but you know that the suffixes are used only as a last resort, as first the file headers are checked for the file type (thanks to Heiko!). So e. g. foo.somejpg is a legal name and would still be recognized as .png if it's a png file :-)
when i test with a unknown format, i get an abort and:
Error: pdftex.exe (file ./hakker1b.tif): unknown type of image
so, in order to know if a funny suffix is a valid one for pdftex, we need something
\pdfcheckimage{somefile.somesiffix}
which sets a flag, say \pdfimagecheck 0/1
like \pdfretval=-1 not recognized \pdfretval=0 PDF \pdfretval=1 PNG \pdfretval=2 JPG \pdfretval=3 JBIG2 or better 0,1,2,3,4? Regards, Hartmut
Hartmut Henkel wrote:
On Mon, 28 Aug 2006, Hans Hagen wrote:
Hartmut Henkel wrote:
On Mon, 28 Aug 2006, Hans Hagen wrote:
It's kind of annoying that pdftex has hard coded suffixes.
how about something
\pdfjpgsuffixes{jpg,jpeg,myjpg} \pdfpngsuffixes{png,somepng} \pdfpdfsuffixes{pdf,epdf,fdf}
but you know that the suffixes are used only as a last resort, as first the file headers are checked for the file type (thanks to Heiko!). So e. g. foo.somejpg is a legal name and would still be recognized as .png if it's a png file :-)
when i test with a unknown format, i get an abort and:
Error: pdftex.exe (file ./hakker1b.tif): unknown type of image
so, in order to know if a funny suffix is a valid one for pdftex, we need something
\pdfcheckimage{somefile.somesiffix}
which sets a flag, say \pdfimagecheck 0/1
like
\pdfretval=-1 not recognized \pdfretval=0 PDF \pdfretval=1 PNG \pdfretval=2 JPG \pdfretval=3 JBIG2
or better 0,1,2,3,4?
right, that would be nice! (0,1,2,...) we should aborted runs as much as possible 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 Mon, Aug 28, 2006 at 10:53:09PM +0200, Hans Hagen wrote:
so, in order to know if a funny suffix is a valid one for pdftex, we need something
\pdfcheckimage{somefile.somesiffix}
which sets a flag, say \pdfimagecheck 0/1
otherwise there is no way to intercept errors
Look at CTAN:macros/latex/contrib/oberdiek/bmpsize.pdf.
Here I have implemented some parsing of binary image file types.
Yours sincerely
Heiko
Hi Heiko,
Look at CTAN:macros/latex/contrib/oberdiek/bmpsize.pdf. Here I have implemented some parsing of binary image file types.
Ah, now I see what was the exact reason for \pdffiledump -) My understanding is that those macros are supposed to be used exclusively with pdf(la)TeX working in DVI mode, right? If not, what is the profit in PDF mode? Regards, -- Pawe/l Jackowski P.Jackowski@gust.org.pl
On Tue, Aug 29, 2006 at 07:42:15AM +0200, Pawe?? Jackowski wrote:
Look at CTAN:macros/latex/contrib/oberdiek/bmpsize.pdf. Here I have implemented some parsing of binary image file types.
Ah, now I see what was the exact reason for \pdffiledump -) My
Yes, that was my intention.
understanding is that those macros are supposed to be used exclusively with pdf(la)TeX working in DVI mode, right? If not, what is the profit in PDF mode?
Hans wanted to have a possibility to check images before
using \pdfximage to avoid errors on unsupported image types.
The method used in bmpsize provides a method to do so.
The other method discussed so far is \pdfcheckimage.
What about \pdfximage that doesn't abort, but print a warning
and \pdfxlastimage returns zero for an invalid image?
Yours sincerely
Heiko
participants (4)
-
Hans Hagen
-
Hartmut Henkel
-
Heiko Oberdiek
-
Paweł Jackowski