On Fri, Jul 27 2012, Peter Münster wrote:

> Does it make sense, to port http://modules.contextgarden.net/t-degrade
> to mkiv, or is there already an existing solution in ConTeXt to
> downsample jpeg-images on the fly?

I've played a bit with the converters:

--8<---------------cut here---------------start------------->8---
\startluacode
figures.converters["jpg"] = {
  ["lowres.jpg"] = function(oldname,newname,resolution)
    os.execute"something"
    print(table.serialize(figures.current()))
  end
}
\stopluacode
\starttext
\externalfigure[hacker][width=0.5\textwidth, conversion=lowres.jpg]
\stoptext 
--8<---------------cut here---------------end--------------->8---

2 questions:

- How can I get the width and/or the height of the figure inside the
  function?  "0.5\9extwidth " is not very useful on the lua-side...

- How can I specify a sub-directory where to place the converted images?
  (not so important, just to avoid cluttering the current directory)


TIA for any help,
-- 
           Peter
___________________________________________________________________________________
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