代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ImageMagick 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 329dd528ab79531d884c0ba131e97d43f872ab5d Mon Sep 17 00:00:00 2001
From: ruc_zhangxiaohui <553441439@qq.com>
Date: Thu, 4 Feb 2021 04:19:08 +0800
Subject: [PATCH] uses the PerceptibleReciprocal() to prevent the
divide-by-zero from occurring (#3194)
Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com>
---
magick/fx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/magick/fx.c b/magick/fx.c
index 07a54eb..5041de6 100644
--- a/magick/fx.c
+++ b/magick/fx.c
@@ -3403,11 +3403,11 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount,
center.y=0.5*image->rows;
radius=center.x;
if (image->columns > image->rows)
- scale.y=(double) image->columns/(double) image->rows;
+ scale.y=(double) image->columns*PerceptibleReciprocal((double) image->rows);
else
if (image->columns < image->rows)
{
- scale.x=(double) image->rows/(double) image->columns;
+ scale.x=(double) image->rows*PerceptibleReciprocal((double) image->columns);
radius=center.y;
}
/*
@@ -3471,11 +3471,11 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount,
*/
factor=1.0;
if (distance > 0.0)
- factor=pow(sin((double) (MagickPI*sqrt((double) distance)/
- radius/2)),-amount);
+ factor=pow(sin((double) (MagickPI*sqrt((double) distance)*PerceptibleReciprocal(
+ radius)/2)),-amount);
status=InterpolateMagickPixelPacket(image,image_view,
- UndefinedInterpolatePixel,(double) (factor*delta.x/scale.x+
- center.x),(double) (factor*delta.y/scale.y+center.y),&pixel,
+ UndefinedInterpolatePixel,(double) (factor*delta.x*PerceptibleReciprocal(scale.x)+
+ center.x),(double) (factor*delta.y*PerceptibleReciprocal(scale.y)+center.y),&pixel,
exception);
if (status == MagickFalse)
break;
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。