(Follow-up r75968) r75968 started extracting and displaying some svg metadata, but...
authorBrian Wolff <bawolff@users.mediawiki.org>
Sun, 13 Feb 2011 04:55:35 +0000 (04:55 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Sun, 13 Feb 2011 04:55:35 +0000 (04:55 +0000)
It started to use the messages svg-description, svg-title, svg-width, and svg-height in the metadata table, without
defining those messages. I changed it to use the same messages as are used when displaying the same table on
the image description pages of jpeg files. ( exif-imagewidth and friends ). Personally I feel the metadata
should be about the image, not what format the metadata was stored in (a description of an image is still a
description of the image, regardless of the format of that image. JPEG images for example can have image descriptions in
3 different metadata formats [exif, iptc, xmp], it would be insane to make different messages for them). Furthermore,
I think we should rename all the exif-* messages to something like filemeta-property (but thats an issue for later).

I added one message, 'exif-objectname', since the svg title property didn't really correspond to anything in exif.
However, it does correspond very well to IPTC's object name property, which i hope we will start supporting in 1.18,
so I used that message for that.

includes/media/SVG.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index 899429c..9a8484f 100644 (file)
@@ -206,11 +206,22 @@ class SvgHandler extends ImageHandler {
 
                // Sort fields into visible and collapsed
                $visibleFields = $this->visibleMetadataFields();
+
+               // Rename fields to be compatible with exif, so that
+               // the labels for these fields work.
+               $conversion = array( 'width' => 'imagewidth',
+                       'height' => 'imagelength',
+                       'description' => 'imagedescription',
+                       'title' => 'objectname',
+               );
                foreach ( $metadata as $name => $value ) {
                        $tag = strtolower( $name );
+                       if ( isset( $conversion[$tag] ) ) {
+                               $tag = $conversion[$tag];
+                       }
                        self::addMeta( $result,
                                in_array( $tag, $visibleFields ) ? 'visible' : 'collapsed',
-                               'svg',
+                               'exif',
                                $tag,
                                $value
                        );
index 299d978..1521b2b 100644 (file)
@@ -3833,6 +3833,7 @@ Others will be hidden by default.
 'exif-gpsareainformation'          => 'Name of GPS area',
 'exif-gpsdatestamp'                => 'GPS date',
 'exif-gpsdifferential'             => 'GPS differential correction',
+'exif-objectname'                  => 'Short title',
 
 # Make & model, can be wikified in order to link to the camera and model name
 'exif-make-value'     => '$1', # do not translate or duplicate this message to other languages
index cf18a5d..7692428 100644 (file)
@@ -3361,6 +3361,7 @@ See also Wikipedia on [http://en.wikipedia.org/wiki/Digital_zoom digital zoom].'
 See also Wikipedia on [http://en.wikipedia.org/wiki/Focal_length#In_photography focal length].',
 'exif-gpslatitude'                 => '{{Identical|Latitude}}',
 'exif-gpslongitude'                => '{{Identical|Longitude}}',
+'exif-objectname'                  => 'This message labels a field in the image metadata table that is a short name or title for the image. (As compared to {{msg-mw|exif-imagedescription}} which is a long description of the image).',
 
 # EXIF attributes
 'exif-compression-6' => '{{optional}}',
index 52783d4..f5765b4 100644 (file)
@@ -617,4 +617,5 @@ $wgEXIFMessages = array(
        'exif-gpsdestdistance-n',
        'exif-gpsdirection-t',
        'exif-gpsdirection-m',
+       'exif-objectname',
 );
index ee35d49..1cfc802 100644 (file)
@@ -2765,6 +2765,7 @@ $wgMessageStructure = array(
                'exif-gpsareainformation',
                'exif-gpsdatestamp',
                'exif-gpsdifferential',
+               'exif-objectname',
        ),
        'exif-values' => array(
                'exif-make-value',