Implements #11884 : Now support Flash EXIF attribute
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 28 Aug 2008 16:31:54 +0000 (16:31 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 28 Aug 2008 16:31:54 +0000 (16:31 +0000)
RELEASE-NOTES
includes/Exif.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index ef73bdf..113c8c4 100644 (file)
@@ -100,6 +100,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   backwards incompatibility with upload extensions.
 * BMP images are now displayed as PNG
 * (bug 13471) Added NUMBERINGROUP magic word
+* (bug 11884) Now support Flash EXIF attribute
 
 === Bug fixes in 1.14 ===
 
index bd93eb7..3c1b1ab 100644 (file)
@@ -780,7 +780,28 @@ class FormatExif {
                                }
                                break;
 
-                       // TODO: Flash
+                       case 'Flash':
+                               $flashDecode = array(
+                                       'fired'    => $val & bindec( '00000001' ),
+                                       'return'   => ($val & bindec( '00000110' )) >> 1,
+                                       'mode'     => ($val & bindec( '00011000' )) >> 3,
+                                       'function' => ($val & bindec( '00100000' )) >> 5,
+                                       'redeye'   => ($val & bindec( '01000000' )) >> 6,
+//                                     'reserved' => ($val & bindec( '10000000' )) >> 7,
+                               );
+
+                               # We do not need to handle unknown values since all are used.
+                               foreach( $flashDecode as $subTag => $subValue ) {
+                                       # We do not need any message for zeroed values.
+                                       if( $subTag != 'fired' && $subValue == 0) {
+                                               continue;
+                                       }
+                                       $fullTag = $tag . '-' . $subTag ;
+                                       $flashMsgs[] = $this->msg( $fullTag, $subValue );
+                               }
+                               $tags[$tag] = join( ',', $flashMsgs );
+                       break;
+
                        case 'FocalPlaneResolutionUnit':
                                switch( $val ) {
                                case 2:
index f318dbb..252c7a3 100644 (file)
@@ -3188,6 +3188,17 @@ Others will be hidden by default.
 'exif-lightsource-24'  => 'ISO studio tungsten',
 'exif-lightsource-255' => 'Other light source',
 
+'exif-flash-fired-0' => 'Flash did not fire',
+'exif-flash-fired-1' => 'Flash fired',
+'exif-flash-return-0' => 'no strobe return detection function',
+'exif-flash-return-2' => 'strobe return light not detected',
+'exif-flash-return-3' => 'strobe return light detected',
+'exif-flash-mode-1' => 'compuslory flash firing',
+'exif-flash-mode-2' => 'compuslory flash suppression',
+'exif-flash-mode-3' => 'auto mode',
+'exif-flash-function-1' => 'No flash function',
+'exif-flash-redeye-1' => 'red-eye reduction mode',
+
 'exif-focalplaneresolutionunit-2' => 'inches',
 
 'exif-sensingmethod-1' => 'Undefined',
index 2c4a938..0edb61f 100644 (file)
@@ -486,6 +486,16 @@ $wgEXIFMessages = array(
        'exif-lightsource-19',
        'exif-lightsource-24',
        'exif-lightsource-255',
+       'exif-flash-fired-0' ,
+       'exif-flash-fired-1' ,
+       'exif-flash-return-0' ,
+       'exif-flash-return-2' ,
+       'exif-flash-return-3' ,
+       'exif-flash-mode-1' ,
+       'exif-flash-mode-2' ,
+       'exif-flash-mode-3' ,
+       'exif-flash-function-1' ,
+       'exif-flash-redeye-1' ,
        'exif-focalplaneresolutionunit-2',
        'exif-sensingmethod-1',
        'exif-sensingmethod-2',
index bce227c..91c7a34 100644 (file)
@@ -2341,6 +2341,18 @@ $wgMessageStructure = array(
                'exif-lightsource-24',
                'exif-lightsource-255',
        ),
+       'exif-flash' => array(
+               'exif-flash-fired-0' ,
+               'exif-flash-fired-1' ,
+               'exif-flash-return-0' ,
+               'exif-flash-return-2' ,
+               'exif-flash-return-3' ,
+               'exif-flash-mode-1' ,
+               'exif-flash-mode-2' ,
+               'exif-flash-mode-3' ,
+               'exif-flash-function-1' ,
+               'exif-flash-redeye-1' ,
+       ),
        'exif-focalplaneresolutionunit' => array(
                'exif-focalplaneresolutionunit-2',
        ),
@@ -2821,6 +2833,7 @@ Variants for Chinese language",
        'exif-subjectdistance-value'     => '',
        'exif-meteringmode'              => '',
        'exif-lightsource'               => '',
+       'exif-flash'                     => 'Flash modes',
        'exif-focalplaneresolutionunit'  => '',
        'exif-sensingmethod'             => '',
        'exif-filesource'                => '',