On Thu, Jan 21, 2016 at 10:10 PM, Patrick Gundlach <[email protected]>
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