File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -230,20 +230,23 @@ public function threshold(string $threshold): string
230230 {
231231 $ threshold = \trim ($ threshold );
232232
233+ if (is_numeric ($ threshold )) {
234+ return $ threshold ;
235+ }
236+
233237 if (substr ($ threshold , -1 ) == '% ' ) {
234- $ percent_num = substr ($ threshold , 0 , -1 );
235- if (is_numeric ($ percent_num )) {
238+ $ percentNumber = substr ($ threshold , 0 , -1 );
239+ if (is_numeric ($ percentNumber )) {
236240 return $ threshold ;
237241 }
238- } else if (is_numeric ($ threshold )) {
239- return $ threshold ;
240242 }
241243
242244 throw new \InvalidArgumentException (\sprintf (
243245 'The specified threshold parameter (%s) is invalid. ' ."\n" .
244- 'The value must be in percentage or an integer ' ."\n" .
246+ 'The value must be an integer or a percentage value ' ."\n" .
245247 'Please refer to ImageMagick command line documentation: ' ."\n%s " ,
246- $ threshold , 'http://www.imagemagick.org/script/command-line-options.php#threshold '
248+ $ threshold ,
249+ 'http://www.imagemagick.org/script/command-line-options.php#threshold '
247250 ));
248251
249252 }
You can’t perform that action at this time.
0 commit comments