Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for whether to make a Retina crop always fails #65

Open
acobster opened this issue Mar 9, 2017 · 0 comments
Open

Check for whether to make a Retina crop always fails #65

acobster opened this issue Mar 9, 2017 · 0 comments

Comments

@acobster
Copy link

acobster commented Mar 9, 2017

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

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

No branches or pull requests

1 participant