Page 1 of 1

-size is SILENTLY ignored as an output option

Posted: 2012-12-07T09:24:27-07:00
by matteosistisette

Code: Select all

convert inputfile.jpg -size 50x50 output.jpg
Expected behavior
I guess -size only makes sense as an input option. If so, then the above command should issue an error or a warning.
Actually I think it would be even better to treat -size as a synonim of -resize when used as output option.

Observed behavior
The option is silently ignored and has no effect. The output image has the same size as the input image.

Re: -size is SILENTLY ignored as an output option

Posted: 2012-12-07T11:41:48-07:00
by fmw42
-size sets the size of a new image created with xc: or canvas:

I think you want -resize to change the size of your input image.

Re: -size is SILENTLY ignored as an output option

Posted: 2012-12-07T12:04:02-07:00
by matteosistisette
I know (as I already mentioned) that -resize is the option I wanted to use in the command above.

The problem is that if you use an option that cannot be applied in the context where it is used, an error or warning should be issued.

Re: -size is SILENTLY ignored as an output option

Posted: 2012-12-07T12:06:19-07:00
by magick
The -size option sets metadata associated with the image. It appears to be an input only option but there is no reason why an image writer couldn't use this value, either now or in the future. For this reason we do not want to report it as an error or warning.

Re: -size is SILENTLY ignored as an output option

Posted: 2012-12-07T12:07:38-07:00
by snibgo
As a general rule, IM processes each element of the command then moves on to the next element. Hence it doesn't know, when it processes "-size", that nothing follows that "-size" could affect.

Re: -size is SILENTLY ignored as an output option

Posted: 2012-12-09T19:37:22-07:00
by anthony
That situation is even worse in the new IMv7 "magick" command 'pipelined options' where each command is processed as it arrives from a data pipeline (such as a controlling program). Whether future options may use a setting is completely unknown.