When I generate images with these command:
gm convert -size "320x320^>" -auto-orient +profile "*" -resize "320x320^>" "small.jpg" "small.d320.jpg"
gm convert -size "640x640^>" -auto-orient +profile "*" -resize "640x640^>" "small.jpg" "small.d640.jpg"
small.jpg is the attached file, but I have tried with others too, no change in result.
Then I expect that I would get an image that is resized to a width of 320 in the first command, and a non-resized image in the second. However the second image is enlarged even though I specify > as an option. I have tried without the -size argument too. The ^ I need since I want to the generated image dimensions to be a minimum of 320 or 640 pixels.
Am I doing something wrong or is this a bug?
Of course I forgot to mention that
small.jpgis 500px × 267px.And now I actually realize that I probably am tired. I'm trying to force a minimum size of 640 and at the same time say that it shouldn't be resized if it's too small...
Close at will.
The -size option does not support this syntax. It would be used as a hint for the maximum desired size when reading from the JPEG file. Not all of the geometry operators work together. The command line is processed from left to right so it is best to express options where they make sense for the operations being performed. If all the options are expressed first, then the older syntax is used and there is not as much control.
I wondered about the
-sizeoption, so it's the maximum desired size, good to know!And regarding order of options, is there some page detailing this? Or is it as simple as <inputfile> options <outputfile>? All option affect the outputfile as I see it.</outputfile></inputfile>
There is not a page which clearly describes option ordering. Options which are settings which apply to a subsequent option (e.g. a color) should appear before that option and options which are operations should appear after any settings which might influence them. The -size option is primarily used before an input file (it is a setting) while an operation (e.g. -resize) is used after an input file.
This issue seems to be due to some confusion due to complex command line options and lack of understanding of how / when they are applied and not due to a bug.