From: Brian Wolff Date: Sun, 13 Feb 2011 04:55:35 +0000 (+0000) Subject: (Follow-up r75968) r75968 started extracting and displaying some svg metadata, but... X-Git-Tag: 1.31.0-rc.0~32012 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=65c27ddeb19757cb8a335b097039f8aeb981013e;p=lhc%2Fweb%2Fwiklou.git (Follow-up r75968) r75968 started extracting and displaying some svg metadata, but didn't add the messages it used. 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. --- diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 899429cc9e..9a8484f147 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -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 ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 299d97806f..1521b2b839 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index cf18a5d88f..7692428578 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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}}', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 52783d4bf3..f5765b4fbc 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -617,4 +617,5 @@ $wgEXIFMessages = array( 'exif-gpsdestdistance-n', 'exif-gpsdirection-t', 'exif-gpsdirection-m', + 'exif-objectname', ); diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index ee35d49ae7..1cfc80200f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2765,6 +2765,7 @@ $wgMessageStructure = array( 'exif-gpsareainformation', 'exif-gpsdatestamp', 'exif-gpsdifferential', + 'exif-objectname', ), 'exif-values' => array( 'exif-make-value',