Open yeganehaym opened 7 years ago
this is an example
So am I , hope this BUG can be resolved.
Same here! Any update on this issue?
After a little debugging, i found the cause of this issue. The method onPreImageLoaded validates the selected image based on some parameters like, the container's width and height, the preview size, max zoom, etc. If the image doesn't pass these criteria, it throws an error and the image isn't displayed.
As a temporary fix for my issue, i commented the reject image if clause in the code:
{
key: 'onPreImageLoaded',
value: function onPreImageLoaded()
{
// if (this.shouldRejectImage({
// imageWidth: this.preImage.width,
// imageHeight: this.preImage.height,
// previewSize: this.previewSize,
// maxZoom: this.options.maxZoom,
// exportZoom: this.options.exportZoom,
// smallImage: this.options.smallImage
// })) {
// this.onImageError(_constants.ERRORS.SMALL_IMAGE);
// if (this.image.src) {
// this.setImageLoadedClass();
// }
// return;
// }
this.image.src = this.preImage.src;
}
},
Hope this helps.
Got same here. Hope it will be fixed. And yes ricky2k7 fix helped me. But it is only temporary solution. Also if i comment this lines i am not able to zoom- in this image which hasn't opened before. However i understand that it might fail to show because image doesnt fit some requirements. If possible please show how to get call callback function to show what is wrong to show user problem or something. thank you in advance.
I am also having this issue. It seems to happen with only certain png files for me.
Even happens on the cropit site using the first demo. I have attached two png photos (stock photos from windows). iis.png works fine but the w-brand.png does not load.
I am gathering from the images I have uploaded and ricky2k7's post that the w-brand.png file fails a size constraint?
Would be great to see a fix for this.
This can be solved using the smallImage: 'allow' option:
$('.image-editor').cropit({ smallImage: 'allow' });
It still keeps the image size specified by the cropit box but you cannot zoom in on the small image. This makes sense because it will become pixelated.
See issue #102.
After a little debugging, i found the cause of this issue. The method onPreImageLoaded validates the selected image based on some parameters like, the container's width and height, the preview size, max zoom, etc. If the image doesn't pass these criteria, it throws an error and the image isn't displayed.
As a temporary fix for my issue, i commented the reject image if clause in the code:
{ key: 'onPreImageLoaded', value: function onPreImageLoaded() { // if (this.shouldRejectImage({ // imageWidth: this.preImage.width, // imageHeight: this.preImage.height, // previewSize: this.previewSize, // maxZoom: this.options.maxZoom, // exportZoom: this.options.exportZoom, // smallImage: this.options.smallImage // })) { // this.onImageError(_constants.ERRORS.SMALL_IMAGE); // if (this.image.src) { // this.setImageLoadedClass(); // } // return; // } this.image.src = this.preImage.src; } },
Hope this helps.
It works!
i've run the html page and its working for well but then came to know doesn't open some images