fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

Bottom or right 1px black line #918

Closed samuel-clara closed 7 years ago

samuel-clara commented 7 years ago

Using the fixed crop box some images are uploaded with 1px of the fillcolor on the bottom or on the right. Maybe it's a problem with the approximation of subpixels. I'm uploading images using HTMLCanvasElement.toBlob() and then php.

This is the code I'm using:

var image_cropper = croppedImg.cropper({
            viewMode: 1,
            dragMode: 'move',
            autoCropArea: 0.85,
            wheelZoomRatio: 0.02,
            restore: false,
            guides: false,
            highlight: false,
            cropBoxMovable: false,
            cropBoxResizable: false,
            aspectRatio: aspectRatio,
            zoom: function (e) { // function to allow maxZoom to max size
                if (e.ratio > 1) {
                    e.preventDefault();
                    $(this).cropper('zoomTo', 1);
                }
            }
 });
LonerKO commented 7 years ago

Yes, have same problem.

fengyuanchen commented 7 years ago

Which version of Cropper? Any screenshots?

samuel-clara commented 7 years ago

Same issue with the v.3.0.0-rc.3 which I'm using now and with v.2.3.2 which I used time ago. What kind of screenshot do you need?

LonerKO commented 7 years ago

View and Cropped image https://prnt.sc/gwf0a4 GetImage https://prnt.sc/gweznw

var imageData = $('.cropper-example-1 > img').cropper('getCroppedCanvas', {
                width: 123,
                height: 92,
                imageSmoothingQuality: 'high'
            }).toDataURL('image/jpeg');

Settings

$('.cropper-example-1 > img').cropper({
                        dragMode: 'move',
                        toggleDragModeOnDblclick: false,
                        cropBoxResizable: false,
                        aspectRatio: 122 / 92,
                        background: false,

                    });

Cropper v3.1.0

Tomefa commented 7 years ago

Yes same problem here with v3.1.1

fengyuanchen commented 7 years ago

The core problem is the same as http://0.30000000000000004.com/

nag5000 commented 7 years ago

Could you please release a new version with that fix?

fengyuanchen commented 7 years ago

v3.1.2 has been released for this.

joostdr commented 5 years ago

@fengyuanchen We are encountering this issue by using the javascript version of the cropper (https://github.com/fengyuanchen/cropperjs). Is it possible that the same bug is still present there?

Dimchao commented 5 years ago

@fengyuanchen this is still very much an issue using both the cropper.js and jQuery cropper tools. Could you point us in the right direction to fix this issue? Thank you.

nugoo1 commented 5 years ago

Is there a fix? Why is this closed