![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
26 May
2012
26 May
'12
8:49 p.m.
On Sun, 27 May 2012, Rogers, Michael K wrote:
I don't know if this helps but the following tells what the type of the image file is. (In my case I copied a jpg to img1 and a png to img2, without extensions of course.)
Thanks. Hans implemented a version of unix file command for checking the type of images, but using the inbuilt library is definely simpler!
\startluacode userdata = userdata or { } function userdata.mytype(s) context(img.scan({filename=s}).imagetype) end \stopluacode
@Hans, btw I also noticed that \locfilename does not work for files without extension. Create a file "one" in the current directory and then run: \message{>>>\locfilename{one}<<<} \end Aditya