mattermost/server/tests/exif_samples
Patel Parthkumar 92533c44c1
Fix EXIF profile picture orientation bug (#34275) (#35594)
* 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>
2026-03-19 15:46:21 +00:00
..
down-mirrored.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down-mirrored.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down-mirrored.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down-mirrored.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
down.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left-mirrored.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left-mirrored.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left-mirrored.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left-mirrored.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
left.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
quadrants-orientation-1.png Fix EXIF profile picture orientation bug (#34275) (#35594) 2026-03-19 15:46:21 +00:00
quadrants-orientation-8.png Fix EXIF profile picture orientation bug (#34275) (#35594) 2026-03-19 15:46:21 +00:00
right-mirrored.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right-mirrored.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right-mirrored.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right-mirrored.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
right.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up-mirrored.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up-mirrored.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up-mirrored.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up-mirrored.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up.jpg [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up.png [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up.tiff [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00
up.webp [MM-63436] Replace Exif parser dependency (#30479) 2025-04-01 13:57:43 -06:00