Store original media dimensions as additional header
authorGilles Dubuc <gilles@wikimedia.org>
Wed, 26 Apr 2017 12:01:49 +0000 (14:01 +0200)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 9 May 2017 22:49:28 +0000 (15:49 -0700)
commitcdfe08439c3b5628060f3b9d9d7ca6523b1a2512
treeec736fa127c355c2d72a8d971cccfe5fd594175b
parentc22d28b17ac45f9e4a292a8862dd68167c2b7fdf
Store original media dimensions as additional header

For storage repos that support headers (such as Swift), this will store the original
media dimensions as an extra custom header, X-Content-Dimensions.
The header is formatted to minimize its length when dealing with multipage
documents, by expressing the information as page ranges keyed by dimensions.

Example for a multipage documents with some pages of different sizes:
X-Content-Dimensions: 1903x899:1-9,11/1903x873:10

Example for a single page document:
X-Content-Dimensions: 800x600:1

Bug: T150741
Change-Id: Ic4c6a86557b3705cf75d074753e9ce2ee070a6df
22 files changed:
RELEASE-NOTES-1.30
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/libs/filebackend/FileBackendStore.php
includes/media/Exif.php
includes/media/ExifBitmap.php
includes/media/FormatMetadata.php
includes/media/GIFMetadataExtractor.php
includes/media/MediaHandler.php
includes/media/PNGMetadataExtractor.php
includes/media/XCF.php
maintenance/importImages.php
maintenance/refreshFileHeaders.php
tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
tests/phpunit/includes/media/ExifTest.php
tests/phpunit/includes/media/GIFMetadataExtractorTest.php
tests/phpunit/includes/media/GIFTest.php
tests/phpunit/includes/media/JpegTest.php
tests/phpunit/includes/media/MediaHandlerTest.php
tests/phpunit/includes/media/PNGTest.php
tests/phpunit/includes/media/TiffTest.php
tests/phpunit/includes/media/XCFTest.php