Page 1 of 1

Problem with "-set option:distort:scale" in IM6 and IM7

Posted: 2018-10-16T16:41:44-07:00
by GeeMack
Using ImageMagick 7.0.8-12 Q16 x64 HDRI (and ImageMagick 6.9.10-11 Q16 x64 HDRI) on Windows, trying to set a scaling factor as described at THIS link. I enter these three commands, and the third one results in an error...

Code: Select all

magick logo: -set option:distort:scale 0.11 -distort SRT 0 test.png

magick logo: -set option:distort:scale 0.10 -distort SRT 0 test.png

magick logo: -set option:distort:scale 0.09 -distort SRT 0 test.png
magick: invalid argument for option -set option:distort:scale @ error/distort.c/DistortImage/2263.
It seems any any factor below 0.1 creates an error. Any facctor of 0.1 and above scales the image as expected.

As a note, I also get the same result with an older ImageMagick 6.8.9-9 on an Ubuntu installation under Windows.

Is this by design, a bug, an oversight?

Re: Problem with "-set option:distort:scale" in IM6 and IM7

Posted: 2018-10-16T16:52:14-07:00
by snibgo
distort.c has an explicit test for values less than 0.1, throwing an error:

Code: Select all

      if ( output_scaling < 0.1 ) {
        coeff = (double *) RelinquishMagickMemory(coeff);
        (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
                "InvalidArgument","%s", "-set option:distort:scale" );
        return((Image *) NULL);
      }
In later code, I can see that values equal to or very close to zero would cause problems, but 0.1 seems far enough that it shouldn't cause problems.

Re: Problem with "-set option:distort:scale" in IM6 and IM7

Posted: 2018-10-16T16:59:29-07:00
by GeeMack
snibgo wrote: 2018-10-16T16:52:14-07:00distort.c has an explicit test for values less than 0.1, throwing an error:
Thanks for looking it over. I'll make sure to use other methods in cases where it might be an issue.