<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 10:10 PM, Patrick Gundlach <span dir="ltr"><<a href="mailto:patrick@gundla.ch" target="_blank">patrick@gundla.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>><br>
>> Is there a way to prevent LuaTeX from stopping the whole process? Is there a function like<br>
>><br>
>> can_you_handle_this_imagetype(filename="foo.tiff")<br>
>><br>
>> ?<br>
><br>
> local imgscan = img.scan<br>
> local supported = { pdf = true, jpg = true, png = true }<br>
><br>
> function img.scan(t)<br>
> if t and t.filename then<br>
> local e = string.match(t.filename,".-%.(.-)$")<br>
> if supported[e] then<br>
> return imgscan(t)<br>
> end<br>
> end<br>
> end<br>
><br>
> local foo = img.scan({filename = "foo.tiff"})<br>
> local foo = img.scan({filename = "foo.pdf"})<br>
<br>
<br>
</span>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?<br>
<span class="HOEnZb"><font color="#888888"><br>
Patrick<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>Why not mimic the Unix file command in Lua ?<br clear="all"><div><br></div>-- <br><div class="gmail_signature">luigi<br></div>
</div></div>