JamesHeinrich / phpThumb

phpThumb() - The PHP thumbnail generator
Other
315 stars 97 forks source link

phpthumb.class.php - wrong variable names used #93

Closed richtrefz closed 6 years ago

richtrefz commented 6 years ago

$radius used on all 3 lines

                        case 'usm':
                            if ($this->ImageMagickSwitchAvailable ('unsharp')) {
                                @list($amount, $radius, $threshold) = explode ('|', $parameter);
                                $amount                         = ($amount ? min (max (intval ($radius), 0), 255) : 80);
                                $radius                         = ($radius ? min (max (intval ($radius), 0), 10) : 0.5);
                                $threshold                      = (strlen ($threshold) ? min (max (intval ($radius), 0), 50) : 3);
JamesHeinrich commented 6 years ago

Thanks. Presumably it should look like

$amount    = ($amount            ? min(max(intval($amount),    0), 255) : 80);
$radius    = ($radius            ? min(max(intval($radius),    0),  10) : 0.5);
$threshold = (strlen($threshold) ? min(max(intval($threshold), 0),  50) : 3);

Fixed in https://github.com/JamesHeinrich/phpThumb/commit/2575c3ec7768536f2e392732709c5608c60b8d63