r10235 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10234‎ | r10235 | r10236 >
Date:00:55, 22 July 2005
Author:avar
Status:old
Tags:
Comment:
* No longer displaying ResolutionUnit at all
* Support for [XY]Resolution
Modified paths:
  • /trunk/phase3/includes/Exif.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exif.php
@@ -579,6 +579,9 @@
580580 global $wgLang;
581581
582582 $tags =& $this->mExif;
 583+
 584+ $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
 585+ unset( $tags['ResolutionUnit'] );
583586
584587 foreach( $tags as $tag => $val ) {
585588 switch( $tag ) {
@@ -628,18 +631,22 @@
629632
630633 // TODO: YCbCrSubSampling
631634 // TODO: YCbCrPositioning
632 - // TODO: If this field does not exists use 2
633 - case 'ResolutionUnit': #p26
634 - switch( $val ) {
635 - case 2: case 3:
636 - $tags[$tag] = $this->msg( $tag, $val );
637 - break;
638 - default:
639 - $tags[$tag] = $val;
640 - break;
 635+
 636+ case 'XResolution':
 637+ case 'YResolution':
 638+ switch( $resolutionunit ) {
 639+ case 2:
 640+ $tags[$tag] = $this->msg( 'XYResolution', 'i', $this->formatNum( $val ) );
 641+ break;
 642+ case 3:
 643+ $this->msg( 'XYResolution', 'c', $this->formatNum( $val ) );
 644+ break;
 645+ default:
 646+ $tags[$tag] = $val;
 647+ break;
641648 }
642649 break;
643 -
 650+
644651 // TODO: YCbCrCoefficients #p27 (see annex E)
645652 case 'ExifVersion': case 'FlashpixVersion':
646653 $tags[$tag] = "$val"/100;

Status & tagging log