Move call to AccelerateMotionBlurImage.
diff --git a/MagickCore/effect.c b/MagickCore/effect.c
index aa309c6..26763c2 100644
--- a/MagickCore/effect.c
+++ b/MagickCore/effect.c
@@ -2047,6 +2047,16 @@
kernel=(MagickRealType *) RelinquishAlignedMemory(kernel);
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
}
+ point.x=(double) width*sin(DegreesToRadians(angle));
+ point.y=(double) width*cos(DegreesToRadians(angle));
+ for (i=0; i < (ssize_t) width; i++)
+ {
+ offset[i].x=(ssize_t) ceil((double) (i*point.y)/hypot(point.x,point.y)-0.5);
+ offset[i].y=(ssize_t) ceil((double) (i*point.x)/hypot(point.x,point.y)-0.5);
+ }
+ /*
+ Motion blur image.
+ */
#if defined(MAGICKCORE_OPENCL_SUPPORT)
blur_image=AccelerateMotionBlurImage(image,kernel,width,offset,exception);
if (blur_image != (Image *) NULL)
@@ -2070,16 +2080,6 @@
blur_image=DestroyImage(blur_image);
return((Image *) NULL);
}
- point.x=(double) width*sin(DegreesToRadians(angle));
- point.y=(double) width*cos(DegreesToRadians(angle));
- for (i=0; i < (ssize_t) width; i++)
- {
- offset[i].x=(ssize_t) ceil((double) (i*point.y)/hypot(point.x,point.y)-0.5);
- offset[i].y=(ssize_t) ceil((double) (i*point.x)/hypot(point.x,point.y)-0.5);
- }
- /*
- Motion blur image.
- */
status=MagickTrue;
progress=0;
image_view=AcquireVirtualCacheView(image,exception);