Open ghost opened 8 years ago
same here please help !!
Could someone fix this? I have the same error.
set width and height properties
$('#image-cropper').cropit({
width: "400px",
height: "400px"
});
I got the error when I used this:
preview: $('.cropit-preview-logo')
Instead of this:
$preview: $('.cropit-preview-logo')
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.
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.