From c71695879594be8a152c55d646c4aac65d9fc024 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 4 Nov 2015 13:25:07 -0700 Subject: [PATCH] Support all values for exif PhotometricInterpretation I just happened to notice that it wasn't displaying properly on File:Great_falls_of_the_potomac_river_washington_dc.tif . The original implementation only used values found in JPEG images, extend it to all allowed values in tiff files. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html for what the values mean Change-Id: I31b78d093668cec076b7f3599acee528229737f6 --- includes/media/FormatMetadata.php | 10 ++++++++++ languages/i18n/en.json | 10 ++++++++++ languages/i18n/qqq.json | 15 +++++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 25f4806194..73eeba667a 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -190,8 +190,18 @@ class FormatMetadata extends ContextSource { case 'PhotometricInterpretation': switch ( $val ) { + case 0: + case 1: case 2: + case 3: + case 4: + case 5: case 6: + case 8: + case 9: + case 10: + case 32803: + case 34892: $val = $this->exifMsg( $tag, $val ); break; default: diff --git a/languages/i18n/en.json b/languages/i18n/en.json index c97b08e9eb..874ef794fd 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2997,8 +2997,18 @@ "exif-compression-34712": "JPEG2000", "exif-copyrighted-true": "Copyrighted", "exif-copyrighted-false": "Copyright status not set", + "exif-photometricinterpretation-0": "Black and white (White is 0)", + "exif-photometricinterpretation-1": "Black and white (Black is 0)", "exif-photometricinterpretation-2": "RGB", + "exif-photometricinterpretation-3": "Palette", + "exif-photometricinterpretation-4": "Transparency mask", + "exif-photometricinterpretation-5": "Seperated (Probably CMYK)", "exif-photometricinterpretation-6": "YCbCr", + "exif-photometricinterpretation-8": "CIE L*a*b*", + "exif-photometricinterpretation-9": "CIE L*a*b* (ICC encoding)", + "exif-photometricinterpretation-10": "CIE L*a*b* (ITU encoding)", + "exif-photometricinterpretation-32803": "Color Filter Array", + "exif-photometricinterpretation-34892": "Linear raw", "exif-unknowndate": "Unknown date", "exif-orientation-1": "Normal", "exif-orientation-2": "Flipped horizontally", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 7298f4e87c..c843397a34 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -3170,8 +3170,19 @@ "exif-compression-34712": "{{optional}}", "exif-copyrighted-true": "The image is under copyright (including if its copyrighted but freely licensed)", "exif-copyrighted-false": "Copyright status is not set in the file.\n\nCompare: {{msg-mw|exif-copyrighted-true}}.", - "exif-photometricinterpretation-2": "{{optional}}", - "exif-photometricinterpretation-6": "{{optional}}", + "exif-photometricinterpretation-0": "{{optional}} Black and white image. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-1": "{{optional}} Black and white image. Commons for B&W tiffs. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-2": "{{optional}} RGB (red green blue) image. Common for colour tiffs. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-3": "{{optional}} See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-4": "{{optional}} See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-5": "{{optional}} See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-6": "{{optional}}\nYCbCr encoding. Common for jpeg images and tiffs with jpeg compressed data", + "exif-photometricinterpretation-8": "{{optional}}\nSee http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-9": "{{optional}}\nSee http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-10": "{{optional}}\nSee http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-32803": "{{optional}}. Used mostly by DNG images. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-photometricinterpretation-34892": "{{optional}}\n Used mostly by DNG images. See http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html", + "exif-unknowndate": "Used if the Exif date and time is \"0000:00:00 00:00:00\".\n\nRelated Exif attributes:\n* {{msg-mw|Exif-datetime}}\n* {{msg-mw|Exif-datetimeoriginal}}\n* {{msg-mw|Exif-datetimedigitized}}\n* {{msg-mw|Exif-datetimereleased}}\n* {{msg-mw|Exif-datetimeexpires}}\n* {{msg-mw|Exif-gpsdatestamp}}\n* {{msg-mw|Exif-dc-date}}\n* {{msg-mw|Exif-datetimemetadata}}", "exif-orientation-1": "0th row: top; 0th column: left\n{{Related|Exif-orientation}}\n{{Identical|Normal}}", "exif-orientation-2": "0th row: top; 0th column: right\n{{Related|Exif-orientation}}", -- 2.20.1