Skip to content
New issue

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

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

Already on GitHub? # to your account

Image not centering if cropping to a smaller result #238

Closed
renztan opened this issue Nov 4, 2016 · 5 comments
Closed

Image not centering if cropping to a smaller result #238

renztan opened this issue Nov 4, 2016 · 5 comments

Comments

@renztan
Copy link

renztan commented Nov 4, 2016

It seems that the plugin is having a hard time centering when cropping the image to smaller view.
croppie1
croppie2

This is the code:
$uploadCrop.croppie('result', { type: 'base64', format: 'png', size: {width: 1000, height: 1000} }).then(function (resp) { $('#img-output').attr('src', resp); });

This was fixed if I removed the 'size' parameter. I need the parameter though.

@thedustinsmith
Copy link
Contributor

Interesting. Could you put together demo demonstrating the whole issue? I don't know what you mean by "cropping the image to smaller view".

Just a heads up, I've seen croppie do something like this when the croppie element is in a modal and it's not completely shown before the bind() is complete.

@renztan
Copy link
Author

renztan commented Nov 5, 2016

Here's a demo of it:
http://codepen.io/tnrnz/pen/KNKLbN?editors=1100

The goal is to shrink the image, that way the resulting image would have some "whitespace" to it.

And yes, I implemented this on a modal, I used the bind() after the modal was completely shown.

@thedustinsmith
Copy link
Contributor

thedustinsmith commented Nov 5, 2016

Thanks for putting together the demo - I definitely see the issue now. I'm guessing that broke when I fixed it for safari/IE. I won't have time to work on this for a couple of weeks - so if you want to dig into it, the issue is somewhere in this function: https://github.com/Foliotek/Croppie/blob/master/croppie.js#L949

If not, I'll get to it as soon as I can.

@thedustinsmith
Copy link
Contributor

I'm going to close this one in favor of #247 - but you get credit for finding it first. That case just has more traction right now.

@joelmatisa
Copy link

hi there,
who could solve this because I have the same bug

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

No branches or pull requests

3 participants