PerlMagick, MotionBlur: "channel" option is missing

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Searle

PerlMagick, MotionBlur: "channel" option is missing

Post 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
Post Reply