[luatex] Prevent stop when tiff file loads

Patrick Gundlach patrick at gundla.ch
Thu Jan 21 22:10:59 CET 2016


>> 
>> 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





More information about the luatex mailing list