Page 1 of 1

PerlMagick, MotionBlur: "channel" option is missing

Posted: 2009-05-28T13:05:54-07:00
by Searle
The "channel" option is missing for MotionBlur, which makes it immossible to generate a transparent MotionBlur. The patch is something like this:

Code: Select all

diff -ur ImageMagick-6.5.1-0.dist/PerlMagick/Magick.xs ImageMagick-6.5.1-0.new/PerlMagick/Magick.xs
--- ImageMagick-6.5.1-0.dist/PerlMagick/Magick.xs       2009-03-24 03:39:05.000000000 +0100
+++ ImageMagick-6.5.1-0.new/PerlMagick/Magick.xs        2009-05-28 18:24:02.000000000 +0200
@@ -369,7 +369,8 @@
       {"channel", MagickChannelOptions} } },
     { "MotionBlur", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"angle", RealReference} } },
+      {"angle", RealReference},
+      {"channel", MagickChannelOptions} } },
     { "OrderedDither", { {"threshold", StringReference},
       {"channel", MagickChannelOptions} } },
     { "Shave", { {"geometry", StringReference}, {"width", IntegerReference},
@@ -8368,7 +8372,9 @@
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
             geometry_info.xi=argument_list[3].real_reference;
-          image=MotionBlurImage(image,geometry_info.rho,geometry_info.sigma,
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].long_reference;
+          image=MotionBlurImageChannel(image,channel,geometry_info.rho,geometry_info.sigma,
             geometry_info.xi,exception);
           break;
         }
Cheers, Searle