wp-manual-image-crop
wp-manual-image-crop copied to clipboard
Check for whether to make a Retina crop always fails
When the ManualImageCrop
class checks whether it should create a Retina crop for the current image, the check will always return false. This is because the make2x
data value is initialized as a boolean in filterPostData()
:
$data['make2x'] = filter_var($_POST['make2x'], FILTER_VALIDATE_BOOLEAN);
...but when cropImage()
checks this value, it uses the strict comparison operator against a string:
// Generate Retina Image
if( isset( $data['make2x'] ) && $data['make2x'] === 'true' ) {
...
}
The code should instead check against literal true
(or, since it represents a checkbox, assume any truthy value means "yes").
I will make a PR for this soon. :)