scottcheng / cropit

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

Reject Small Image #215

Open mondotino opened 8 years ago

mondotino commented 8 years ago

Have just tried to test the small image rejection using your basic.html demo as below. It will not reject an image of 480 x 640 when I think it should. Can you point out what I'm doing wrong.

  $(function() {
    $('.image-editor').cropit({
      minZoom: 'fit',
      maxZoom: 2,
      width: 300,
      height: 400,
      imageBackground: false,
      exportZoom: 2,
      smallImage: 'reject',
      onImageError: function(error) {
          console.log('Image error');
      }
    });
    $('.rotate-cw').click(function() {
      $('.image-editor').cropit('rotateCW');
    });
    $('.rotate-ccw').click(function() {
      $('.image-editor').cropit('rotateCCW');
    });
    $('.export').click(function() {
      var imageData = $('.image-editor').cropit('export');
      window.open(imageData);
    });
  });
mondotino commented 8 years ago

I think I found it. It works for a very small image so my guess is that rejection takes account of the maxZoom property. So if imageSize x maxZoom would fit in the window it is not rejected.