From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Use figures without file extension
Date: Sat, 26 May 2012 22:49:06 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.02.1205262246550.13255@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <BFE26554-2CA4-407B-8C23-C18A25A32BB5@emory.edu>
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2012-05-27 2:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-26 2:08 Aditya Mahajan
2012-05-26 9:28 ` Hans Hagen
2012-05-26 13:39 ` Hans Hagen
2012-05-26 14:04 ` Aditya Mahajan
2012-05-26 14:23 ` Hans Hagen
2012-05-26 14:26 ` luigi scarso
2012-05-27 1:43 ` Rogers, Michael K
2012-05-27 2:49 ` Aditya Mahajan [this message]
2012-05-27 13:09 ` Rogers, Michael K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.02.1205262246550.13255@ybpnyubfg.ybpnyqbznva \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).