Open blue-eyed-devil opened 7 years ago
Not working....still getting the black line after cropp an image =(
try this one: https://github.com/blue-eyed-devil/croppic and clear cache before you test so browser will get new version of js file
I had this same issue and could only resolve it by applying the forked version.
It should be
var cropData = { imgUrl:that.imgUrl, imgInitW:that.imgInitW, imgInitH:that.imgInitH, imgW:that.imgW+3, imgH:that.imgH+3, imgY1:Math.abs(parseInt(that.img.css('top'))-1), imgX1:Math.abs(parseInt(that.img.css('left'))-1), cropH:that.objH, cropW:that.objW, rotation:that.actualRotation };
in croppic.js file.
when picture moved on the edge and cropped, it adds 1px thick black border on the edge (same even in example files from zip package). I found the way how to fix it. This:
if (parseInt(that.img.css('top')) > 0) { that.img.css('top', 0); if (that.options.imgEyecandy) { that.imgEyecandy.css('top', 0);}} var maxTop = -( that.imgH - that.objH); if (parseInt(that.img.css('top')) < maxTop) { that.img.css('top', maxTop); if (that.options.imgEyecandy) { that.imgEyecandy.css('top', maxTop); }}
Must be changed to:
if (parseInt(that.img.css('top')) > 0) { that.img.css('top', 1); if (that.options.imgEyecandy) { that.imgEyecandy.css('top', 1);}} var maxTop = -( that.imgH - that.objH); if (parseInt(that.img.css('top')) < maxTop) { that.img.css('top', maxTop+2); if (that.options.imgEyecandy) { that.imgEyecandy.css('top', maxTop+2); }}
And this:
if( parseInt( that.img.css('left')) > 0 ){ that.img.css('left',0); if(that.options.imgEyecandy){ that.imgEyecandy.css('left', 0); }} var maxLeft = -( that.imgW-that.objW); if( parseInt( that.img.css('left')) < maxLeft){ that.img.css('left', maxLeft); if(that.options.imgEyecandy){ that.imgEyecandy.css('left', maxLeft); } }
Must be changed to:
if( parseInt( that.img.css('left')) > 0 ){ that.img.css('left',1); if(that.options.imgEyecandy){ that.imgEyecandy.css('left', 1); }} var maxLeft = -( that.imgW-that.objW); if( parseInt( that.img.css('left')) < maxLeft){ that.img.css('left', maxLeft+2); if(that.options.imgEyecandy){ that.imgEyecandy.css('left', maxLeft+2); } }