Support all values for exif PhotometricInterpretation
authorBrian Wolff <bawolff+wn@gmail.com>
Wed, 4 Nov 2015 20:25:07 +0000 (13:25 -0700)
committerBrian Wolff <bawolff+wn@gmail.com>
Wed, 4 Nov 2015 20:44:37 +0000 (13:44 -0700)
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
languages/i18n/en.json
languages/i18n/qqq.json

index 25f4806..73eeba6 100644 (file)
@@ -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:
index c97b08e..874ef79 100644 (file)
        "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",
index 7298f4e..c843397 100644 (file)
        "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 \"<code>0000:00:00 00:00:00</code>\".\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}}",