DefaultImageHeaderParser fails to determine correct orientation
- Dominant language
- Java
- Stars
- 35k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
**Glide Version**: 4.10.0
**Integration libraries**: none
**Device/Android Version**: Pixel 2 XL Android 10
**Issue details / Repro steps / Use case background**: Glide (but in its defense also my browser) fails to determine the orientation of this image:

[`DefaultImageHeaderParser#getOrientation()`](https://github.com/bumptech/glide/blob/6022f500e18fccfbe364ceabccc29d153bceb930/library/src/main/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParser.java#L163) returns `UNKNOWN_ORIENTATION`.
However, Android's gallery app and my Linux image viewer apps display the orientation correctly. Here's jhead output:
```
Resolution : 800 x 600
Orientation : rotate 90
Jpeg process : Progressive
JPEG Quality : 93
```
So the orientation is in there, but maybe it is hard to parse?
Contributor guide
Research direction
Start with library/src/main/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParser.java, especially getOrientation(), and reproduce the issue with the linked JPEG on the reported Android setup. Compare the parser result with the orientation reported by jhead and the expected 90-degree rotation. Done means the image's orientation is detected instead of returning UNKNOWN_ORIENTATION.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100