-
-
Notifications
You must be signed in to change notification settings - Fork 437
fix: add guards for MagickImage.BilateralBlur #1545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add guards for MagickImage.BilateralBlur #1545
Conversation
|
In your other PR you used |
|
PR Updated according to your requests 🙂 |
| Throw.IfFalse(nameof(width), width > 1, "The width must be > 1"); | ||
| Throw.IfFalse(nameof(height), height > 1, "The height must be > 1"); | ||
| Throw.IfNegative(nameof(width), width); | ||
| Throw.IfNegative(nameof(height), height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a newline after the Thow's? I do that in the rest of the library.
p.s. I missed that in your other pr...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
👋
size_tforwitdh&height; some lines later, they are bounded to 1 at minimumMagick.NET/src/Magick.NET/Native/MagickImage.cs
Lines 4157 to 4182 in 6035129
Same could be done for
intensitySigma&spatialSigma, but ImageMagick always multiply each param by itself, making them always positive.On one hand, it's already "safe".
On the other hand, there is nothing (at least comments) telling it must be
> 0.Regards.
Edit: added the exception tag that was missing (even without my modifications)