scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 304 forks source link

Fixing rejectSmallImage + minZoom #71

Closed amitkumar closed 9 years ago

amitkumar commented 9 years ago

Issue was that if rejectSmallImage was set to false (allowing a small image) and minZoom was set to 'fill' (meaning the user intended the image to fill the preview), the 'fill' option was being ignored.

Cain-Ish commented 9 years ago

There's 'fit' not 'fill' option for 'minZoom' option

scottcheng commented 9 years ago

@amitkumar Thank you for the PR! It solves the issue perfectly, but after some thoughts I think it makes more sense to separate minZoom and small image options. I'm replacing rejectSmallImage with a more flexible smallImage option that takes a string, which can be 'allow', 'reject', or 'stretch'. When it's 'stretch', the minZoom follows whatever minZoom option is. When it's 'allow', small images can be zoomed down to 100%, overriding minZoom option. I'm making that change now.

@Cain-Ish yes there is a 'fill'. Sorry I've not got to update the website, but for now the options doc could be found here.

scottcheng commented 9 years ago

Added smallImage option in 9bdefa8bb51d6ccd4486f965dbf447f009193fb3.