scottcheng / cropit

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

previewSize undefined still happening #188

Open ghost opened 8 years ago

ghost commented 8 years ago

I've just tried the last version to update my code that used the 0.4 version, and I got a 'previewSize undefined' error. After few investigation I found issue #165 and also noticed that the last commit was about this bug.

This is strange because the bug is actually supposed to be fixed. I did a couple of tries and even with the most simple demo code I was getting the error.

I managed to make my code work by fixing the .cropit-preview div's width and height, but I found strange that the bug still happens.

deveshgoyal commented 8 years ago

same here please help !!

jircdev commented 7 years ago

Could someone fix this? I have the same error.

drj-io commented 7 years ago

set width and height properties

      $('#image-cropper').cropit({

        width: "400px",
        height: "400px"
      });
tomasswood commented 7 years ago

I got the error when I used this: preview: $('.cropit-preview-logo') Instead of this: $preview: $('.cropit-preview-logo')

kongakong commented 7 years ago

According to the documentation of 'Initialization options' section here: http://scottcheng.github.io/cropit/, the default value is supposed to be '$imageCropper.find('.cropit-preview')'

However searching the code I don't think it is executed at all. That's why $preview is undefined when I did not expect it to be.