andismith / grunt-responsive-images

Produce images at different sizes for responsive websites.
http://www.andismith.com/grunt-responsive-images/
MIT License
719 stars 96 forks source link

Corrects 'sample' function overriding 'crop' function #124

Open jhannwong opened 7 years ago

jhannwong commented 7 years ago

When the code finds that user did not call for 'sample' function, the code correctly assumes the task must do a 'resize'.

Unfortunately, the default behavior ('resize') should have been specified higher up in the code, rather than as an if-else in the check for user-call to 'sample' function.

andismith commented 7 years ago

Hi,

Thanks for this, sounds like we should look to fix this. However, the built-in tests for this are currently failing which suggests these changes have changed the expected output.

Have you tried running the test locally to check they pass? Just run grunt in this repo.

Thanks, Andi

jhannwong commented 7 years ago

@andismith All tests pass locally. grunt nodeunit:tests. The failed tests seem to indicate unexpected output image resolutions.

Is it possible this bug had caused us to expect the wrong output image resolutions?

@andismith Indeed, this bug had caused us to write the tests wrong. See the 1st test where we expect wrong output image dimensions.