Am 22.09.24 um 09:06 schrieb Peter Münster:
On Sat, Sep 21 2024, Henning Hraban Ramm wrote:
How can a converter function access … – the final (scaled) size of a placed image
Hi,
I use "figures.current().request" in my module (here attached).
– the original pixel size of an image ?
I use img.scan() for that.
Hi Peter, are you sure that your code works with LMTX? Find attached my version. It seems to work, but only for the first instance of an image, not for different sizes of the same image – makes sense WRT efficiency, but might give wrong results for some uses. Here’s my test code: """ \loadluafile[grph-downsample.lua] \setupexternalfigure[ location={local,global,default}, conversion=lowres.jpg, resolution=20, ] \starttext \useexternalfigure[zapf][https://upload.wikimedia.org/wikipedia/commons/d/dd/Hermann_Zapf_signing.jpg] \useexternalfigure[lino][https://upload.wikimedia.org/wikipedia/commons/b/bd/Linotype-vorne-deutsches...] \externalfigure[zapf][width=.5tw] \externalfigure[lino][height=.3th] \externalfigure[zapf][height=.5th] \stoptext """ Hraban