mirror of
https://github.com/mattermost/mattermost.git
synced 2026-04-11 12:07:53 -04:00
* Fix EXIF profile picture orientation bug (#34275) * Test AdustProfileImage with rotated PNG assets This commit adds two test assets: - quadrants-orientation-1.png - quadrants-orientation-8.png Both represent the exact same image: a 128x128 image with four differently coloured 64x64 quadrants. Clockwise, starting from the top-left: green, white, blue and red [G][W] [R][B] quadrants-orientation-1.png has an EXIF rotation tag of 1, meaning that its data is already correctly rotated. quadrants-orientation-8.png has an EXIF rotation tag of 8, meaning that the data in the file is rotated 90° clockwise, and an inverse rotation needs to be applied to render it correctly. Rendering the raw data would show the following: [R][G] [B][W] That rotation is what we test in the new TestAdjustProfileImage sub-test, which calls AdjustImage in both PNGs and make a byte-to-byte comparison of the result, which is expected to be equal. * Fix imports --------- Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> |
||
|---|---|---|
| .. | ||
| down-mirrored.jpg | ||
| down-mirrored.png | ||
| down-mirrored.tiff | ||
| down-mirrored.webp | ||
| down.jpg | ||
| down.png | ||
| down.tiff | ||
| down.webp | ||
| left-mirrored.jpg | ||
| left-mirrored.png | ||
| left-mirrored.tiff | ||
| left-mirrored.webp | ||
| left.jpg | ||
| left.png | ||
| left.tiff | ||
| left.webp | ||
| quadrants-orientation-1.png | ||
| quadrants-orientation-8.png | ||
| right-mirrored.jpg | ||
| right-mirrored.png | ||
| right-mirrored.tiff | ||
| right-mirrored.webp | ||
| right.jpg | ||
| right.png | ||
| right.tiff | ||
| right.webp | ||
| up-mirrored.jpg | ||
| up-mirrored.png | ||
| up-mirrored.tiff | ||
| up-mirrored.webp | ||
| up.jpg | ||
| up.png | ||
| up.tiff | ||
| up.webp | ||