Hi Hans, Could you please add the following little patch (or something similar) to grph-inc.lua: --- grph-inc.lua~ 2013-01-03 23:32:37.297732874 +0100 +++ grph-inc.lua 2013-01-03 23:42:18.237157620 +0100 @@ -571,6 +571,9 @@ if resolution and resolution ~= "" then -- the order might change newbase = newbase .. "_" .. resolution end + local width = figures.current().request.width or "" + local height = figures.current().request.height or "" + newbase = newbase .. "_" .. width .. "_" .. height -- -- see *, we had: -- The image-downsampling-module¹ would work much better then, because when the name of the file includes the width and the height, there will be a new conversion when the figure dimensions change. ¹ http://modules.contextgarden.net/grph-downsample -- Peter
On 1/4/2013 12:15 AM, Peter Münster wrote:
Hi Hans,
Could you please add the following little patch (or something similar) to grph-inc.lua:
--- grph-inc.lua~ 2013-01-03 23:32:37.297732874 +0100 +++ grph-inc.lua 2013-01-03 23:42:18.237157620 +0100 @@ -571,6 +571,9 @@ if resolution and resolution ~= "" then -- the order might change newbase = newbase .. "_" .. resolution end + local width = figures.current().request.width or "" + local height = figures.current().request.height or "" + newbase = newbase .. "_" .. width .. "_" .. height -- -- see *, we had: --
I don't like that figures.current reference there; also, the image isn't always scanned yet so the original dimensions are not known. The code a bit below that checks for a time change so that should cover an update of an image and trigger a resample. Now, if it is the target width/height you want to be part of the name, then it should be some option, because the one thing you don't want is for instance an eps to pdf converter to be applied 10 times if the same image (logo or so) is included 10 times in a different size.
The image-downsampling-module¹ would work much better then, because when the name of the file includes the width and the height, there will be a new conversion when the figure dimensions change.
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 -----------------------------------------------------------------
On Sat, Jan 05 2013, Hans Hagen wrote:
I don't like that figures.current reference there;
I don't know any other method...
also, the image isn't always scanned yet so the original dimensions are not known.
Doesn't matter for this use-case: I just want to make sure, that a new conversion is triggered, when the requested dimensions change.
The code a bit below that checks for a time change so that should cover an update of an image and trigger a resample.
That's why I want to use your conversion-framework :)
Now, if it is the target width/height you want to be part of the name, then it should be some option, because the one thing you don't want is for instance an eps to pdf converter to be applied 10 times if the same image (logo or so) is included 10 times in a different size.
All right, I can make a new patch with an option (defaults to "no"), but please tell me, how I can avoid "figures.current"? And what's a good name for such an option? -- Peter
participants (2)
-
Hans Hagen
-
Peter Münster