Embed TinyRGB color profile when JPG EXIF Color Space = sRGB but no profile embedded
authorMatthias Mullie <git@mullie.eu>
Tue, 30 Aug 2016 14:36:09 +0000 (16:36 +0200)
committerMatthias Mullie <mmullie@wikimedia.org>
Tue, 15 Nov 2016 12:17:31 +0000 (12:17 +0000)
commita428e3f067ee5b7eececc2a30a7ecb516425db4b
tree5c1e30976311a2b01b1b6a53359d366b1adbbeea
parentd066d5d4065c0553fb9deb069f98af6cb222e610
Embed TinyRGB color profile when JPG EXIF Color Space = sRGB but no profile embedded

Existing srgb.jpg & tinyrgb.jpg have been replaced to be able to
easily compare a "fixed" missingprofile.jpg to tinyrgb.jpg.
With the existing files, when the tinyrgb profile was added to
missingprofile.jpg, it would end up basically the same as tinyrgb.jpg,
except that not all the exif data would be in the exact same order.
I've rebuilt srgb.jpg & tinyrgb.jpg by first removing their profile
(which is what missingprofile.jpg is), and then copying it over again:
    exiftool -tagsfromfile srgb.jpg -ICC_Profile new_srgb.jpg

Meanwhile also moved the profile-swapping code to JpegHandler, as it
was jpeg-specific.

Bug: T134498
Change-Id: I722dd6f66f6007182ad9a215e5eb382776983c05
includes/media/ExifBitmap.php
includes/media/Jpeg.php
tests/phpunit/data/media/adobergb.jpg [new file with mode: 0644]
tests/phpunit/data/media/missingprofile.jpg [new file with mode: 0644]
tests/phpunit/data/media/srgb.jpg
tests/phpunit/data/media/tinyrgb.jpg
tests/phpunit/includes/media/ExifBitmapTest.php
tests/phpunit/includes/media/JpegTest.php