[luatex] Prevent stop when tiff file loads
luigi scarso
luigi.scarso at gmail.com
Thu Jan 21 22:56:50 CET 2016
On Thu, Jan 21, 2016 at 10:10 PM, Patrick Gundlach <patrick at gundla.ch>
wrote:
> >>
> >> Is there a way to prevent LuaTeX from stopping the whole process? Is
> there a function like
> >>
> >> can_you_handle_this_imagetype(filename="foo.tiff")
> >>
> >> ?
> >
> > local imgscan = img.scan
> > local supported = { pdf = true, jpg = true, png = true }
> >
> > function img.scan(t)
> > if t and t.filename then
> > local e = string.match(t.filename,".-%.(.-)$")
> > if supported[e] then
> > return imgscan(t)
> > end
> > end
> > end
> >
> > local foo = img.scan({filename = "foo.tiff"})
> > local foo = img.scan({filename = "foo.pdf"})
>
>
> in my (real) case I don't have a file extension. I need to ask LuaTeX: do
> you understand that file format? I guess there is no way except for a fatal
> error, right?
>
> Patrick
>
>
>
>
Why not mimic the Unix file command in Lua ?
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20160121/437c2ef6/attachment-0001.html>
More information about the luatex
mailing list