Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

black border after crop #260

Open
blue-eyed-devil opened this issue Mar 5, 2017 · 4 comments
Open

black border after crop #260

blue-eyed-devil opened this issue Mar 5, 2017 · 4 comments

Comments

@blue-eyed-devil
Copy link

blue-eyed-devil commented Mar 5, 2017

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); } }

@Master-Y0da
Copy link

Not working....still getting the black line after cropp an image =(

@blue-eyed-devil
Copy link
Author

blue-eyed-devil commented Jun 7, 2017

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

@Jafo232
Copy link

Jafo232 commented Aug 3, 2017

I had this same issue and could only resolve it by applying the forked version.

@tuptuptup
Copy link

tuptuptup commented Mar 12, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants