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

Some images shift to the left when uploaded - not centred. #327

Closed
thatandyrose opened this issue May 26, 2017 · 2 comments
Closed

Some images shift to the left when uploaded - not centred. #327

thatandyrose opened this issue May 26, 2017 · 2 comments

Comments

@thatandyrose
Copy link

This is an easy one to recreate you'll be happy to hear! :-)

So, I found this only happens with some images, particularly images taken with the iPhone camera.

Here's a couple:

https://www.dropbox.com/s/2exebs9ticdewe3/Speaker.jpeg?dl=1
https://www.dropbox.com/s/ckxfs89978pk6yg/IMG_2111.JPG?dl=1

Now, go to your homepage:

https://foliotek.github.io/Croppie/

Then, go down to the upload/exifjs demo, the first demo with the upload button.

screen shot 2017-05-26 at 16 22 21

Now upload either of those images. You'll see they upload but show shifted to the left, not centred.

Here's an image I grabbed from google. Notice it doesn't happen with this image:

https://www.dropbox.com/s/0r93a8m07e4juky/long.jpg?dl=1

Any ideas?

@thatandyrose
Copy link
Author

Just a couple of updates.

  1. Here's what it looks like when it goes wrong:

screen shot 2017-05-26 at 17 32 53

  1. Note that when I downgraded to 2.4.0 it works again :-)

So something in 2.4.0 => 2.4.1 broke it.

@thedustinsmith
Copy link
Contributor

Sorry for the delay, but I finally found the issue. Thanks for the detailed submission, it really helped.

In 2.4.1 someone added something to center the image on binding. This used the img's width and height. With mobile oriented images, those dimensions got mixed up in certain circumstances. I've added a helper method to get the correct dimensions.

This should be fixed with the next release.

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

2 participants