mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-27 05:37:15 -05: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>