r82048 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82047‎ | r82048 | r82049 >
Date:04:55, 13 February 2011
Author:bawolff
Status:ok
Tags:
Comment:
(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.
Modified paths:
  • /trunk/phase3/includes/media/SVG.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2765,6 +2765,7 @@
27662766 'exif-gpsareainformation',
27672767 'exif-gpsdatestamp',
27682768 'exif-gpsdifferential',
 2769+ 'exif-objectname',
27692770 ),
27702771 'exif-values' => array(
27712772 'exif-make-value',
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -617,4 +617,5 @@
618618 'exif-gpsdestdistance-n',
619619 'exif-gpsdirection-t',
620620 'exif-gpsdirection-m',
 621+ 'exif-objectname',
621622 );
Index: trunk/phase3/includes/media/SVG.php
@@ -206,11 +206,22 @@
207207
208208 // Sort fields into visible and collapsed
209209 $visibleFields = $this->visibleMetadataFields();
 210+
 211+ // Rename fields to be compatible with exif, so that
 212+ // the labels for these fields work.
 213+ $conversion = array( 'width' => 'imagewidth',
 214+ 'height' => 'imagelength',
 215+ 'description' => 'imagedescription',
 216+ 'title' => 'objectname',
 217+ );
210218 foreach ( $metadata as $name => $value ) {
211219 $tag = strtolower( $name );
 220+ if ( isset( $conversion[$tag] ) ) {
 221+ $tag = $conversion[$tag];
 222+ }
212223 self::addMeta( $result,
213224 in_array( $tag, $visibleFields ) ? 'visible' : 'collapsed',
214 - 'svg',
 225+ 'exif',
215226 $tag,
216227 $value
217228 );
Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -3361,6 +3361,7 @@
33623362 See also Wikipedia on [http://en.wikipedia.org/wiki/Focal_length#In_photography focal length].',
33633363 'exif-gpslatitude' => '{{Identical|Latitude}}',
33643364 'exif-gpslongitude' => '{{Identical|Longitude}}',
 3365+'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).',
33653366
33663367 # EXIF attributes
33673368 'exif-compression-6' => '{{optional}}',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3833,6 +3833,7 @@
38343834 'exif-gpsareainformation' => 'Name of GPS area',
38353835 'exif-gpsdatestamp' => 'GPS date',
38363836 'exif-gpsdifferential' => 'GPS differential correction',
 3837+'exif-objectname' => 'Short title',
38373838
38383839 # Make & model, can be wikified in order to link to the camera and model name
38393840 'exif-make-value' => '$1', # do not translate or duplicate this message to other languages

Follow-up revisions

RevisionCommit summaryAuthorDate
r821511.17wmf1: MFT r78964, r79086, r79087, r79091, r82004, r82025, r82048, r82070,...catrope22:55, 14 February 2011
r85151MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ...demon20:39, 1 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75968* The SVGMetadataExtractor now based on XmlReader...hartman00:35, 4 November 2010

Status & tagging log