ImageMagickPHP icon indicating copy to clipboard operation
ImageMagickPHP copied to clipboard

Implement threshold option

Open fariasmaiquita opened this issue 4 years ago • 2 comments

Hi thanks for this package!

Could you by any chance implement the threshold option? I would do it myself and make a pull request but I'm not yet well versed enough on things to try it out myself.

Hope to hear from you soon.

fariasmaiquita avatar Jul 23 '20 08:07 fariasmaiquita

Hey @fariasmaiquita, thanks for using this package :slightly_smiling_face:

If you want to contribute, first check the details of the option to know what are the arguments: http://www.imagemagick.org/script/command-line-options.php#threshold

Then, you see that the value is either a signed number with or without the % sign, so you can take examples of options like this one (-strokewidth) for the base implementation.

For the validator, you can create a function threshold(string $value) method in the References.php class to check that the value is a percentage or number, and if validation fails, throw an exception with as many explanations as you can, just like in other validation methods.

Does this seem doable for your first contribution here? :wink:

Pierstoval avatar Jul 23 '20 08:07 Pierstoval

Fixed by #25 and released in 3.0.13 :rocket:

Pierstoval avatar Jul 31 '20 07:07 Pierstoval