Greetings Kees,

Actually that is the point of the issue. The GUI, and I assume the plugin
when called from a macro, has the feature, when 'constrain' is on, that
you can specify either width OR height and the plugin will calculate the
other dimension such that the aspect ratio is maintained. With the GUI,
which field you type into indicates that the other dimension is to be
calculated, and so it does. If I specify both in the macro invocation, and
the 'constrain' option is specified (as per 'record'), how does the plugin
know which one to set and which one to calculate??? If the macro needs to
do this calculation then why the 'constrain' macro option?

Also, to be pedantic, if this invocation is in error, then the plugin
should not quietly use values I did not specify over the ones I did
specify.

Thanks,

Fred


On Mon, September 2, 2024 6:41 am, Straatman, Kees (Dr.) wrote:
> Dear Fred,
>
> You missed the "width" option: run("Size...", " width=256 height=256
> depth=1 constrain average interpolation=None");
>
> Best wishes
> Kees
>
> -----Original Message-----
> From: Fred Damen <[email protected]>
> Sent: 31 August 2024 05:36
> To: [email protected]
> Subject: Size... and a question
>
> ***CAUTION:*** This email was sent from an EXTERNAL source. Think before
> clicking links or opening attachments.
>
> Greetings,
>
> If you run
> run("Size...", "height=256 depth=1 constrain average interpolation=None");
> from a macro the image will resize to what was previously resized using
> the GUI Image/Adjust/Size... and not what was specified in the macro
> command.  I assume this would be the parameters if the height is to be set
> and the aspect ratio of the image being resize is maintained.
>
> newImage("Untitled", "32-bit noise", 128, 128, 1); Image/Adjust/Size...
> Height->1024 newImage("Untitled", "32-bit noise", 128, 128, 1);
> run("Size...", "height=256 depth=1 constrain average interpolation=None");
>
> Bonus question:
> Is there an macro equivalent of setting ImagePlus.changes to false? Or a
> way of closing an image without the save/dont save popup?
>
> Thanks,
>
> Fred
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Reply via email to