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

Image orientation error when load image from network #387

Closed
TangKe opened this issue Apr 2, 2015 · 4 comments
Closed

Image orientation error when load image from network #387

TangKe opened this issue Apr 2, 2015 · 4 comments
Labels
Milestone

Comments

@TangKe
Copy link

TangKe commented Apr 2, 2015

@sjudd when i load image from remote server, i found the orientation is error, using the version 3.5.2, and test image url: http://img13.360buyimg.com/ee/jfs/t1252/164/367048070/2578186/8ea03123/551cb4bdN0114fb62.jpg

i already check the exif info of this image, Chrome can display correctly

@TWiStErRob
Copy link
Collaborator

Woah, never seen this before: in android Chrome it was loading the bitmap lines in vertical columns from the right. This must be some exotic image.

@TangKe
Copy link
Author

TangKe commented Apr 2, 2015

@TWiStErRob this image was captured by the camera of Samsung Galaxy s4, no modified.

@sjudd sjudd added the bug label Apr 3, 2015
@sjudd
Copy link
Collaborator

sjudd commented Apr 3, 2015

Thanks I'll take a look.

@sjudd
Copy link
Collaborator

sjudd commented Apr 4, 2015

It's actually due to lower server bandwidth I think. We're asking to read and/or skip small amounts of data in ImageHeaderParser and expecting (without verifying) that we skip/read the entire amount at once. In fact we actually only manage to read or skip some of the expected data. Since we fail to retry (ie continue to call read/skip while the return value is > 0) when we read/skip fewer than the expected bytes, we sometimes fail to correctly parse the image header.

Nice find, thanks for the report!

@sjudd sjudd added this to the 3.6.0 milestone Apr 4, 2015
@sjudd sjudd closed this as completed in 52985d7 Apr 4, 2015
sjudd added a commit to sjudd/glide that referenced this issue Apr 6, 2015
Fixes bumptech#387
Conflicts:
	library/src/androidTest/java/com/bumptech/glide/load/resource/bitmap/ImageHeaderParserTest.java
	library/src/androidTest/java/com/bumptech/glide/resize/load/ExifTest.java
	library/src/main/java/com/bumptech/glide/load/resource/bitmap/ImageHeaderParser.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants