Skip to content

Conversation

@Gounlaf
Copy link
Contributor

@Gounlaf Gounlaf commented Feb 9, 2024

👋

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)

@dlemstra
Copy link
Owner

dlemstra commented Feb 9, 2024

In your other PR you used Throw.IfNegative. I think I would prefer to have a consistent api and also use that here. And I don't think I would want to have the (>0) in the xml comments. And you should also update the interface to add this: /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>.

@Gounlaf
Copy link
Contributor Author

Gounlaf commented Feb 9, 2024

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);
Copy link
Owner

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@dlemstra dlemstra merged commit 830f7d8 into dlemstra:main Feb 9, 2024
@Gounlaf Gounlaf deleted the magickimage-bilateralblur-guards branch February 9, 2024 18:46
This was referenced Jul 23, 2025
This was referenced Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants