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