On 29-6-2011 7:20, Aditya Mahajan wrote:
On Wed, 29 Jun 2011, Hans Hagen wrote:

Such a plugin looks like:

\startluacode
figures.converters.png = {
png = function(oldname,newname,resolution)
local command = string.format('gm convert -depth 1 "%s"
"%s"',oldname,newname)
logs.report(string.format("running command %s",command))
os.execute(command)
end
}
\stopluacode

Don't you need to use 'resolution' somewhere in the function?

Well, not 'need' but it would make sense of course to use that info, for instance to set the depth or resolution but I wasn't in the mood for studying the man pages (and I always forget the command line arguments), so I leave that 'as an exercise for the reader'.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to