From b928d7f50554577a2cfbe01c17a5cfba1b8bda5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 22 Jul 2005 00:55:54 +0000 Subject: [PATCH] * No longer displaying ResolutionUnit at all * Support for [XY]Resolution --- includes/Exif.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/includes/Exif.php b/includes/Exif.php index 5ee4eabd37..7e901759b3 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -579,6 +579,9 @@ class FormatExif { global $wgLang; $tags =& $this->mExif; + + $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3; + unset( $tags['ResolutionUnit'] ); foreach( $tags as $tag => $val ) { switch( $tag ) { @@ -628,18 +631,22 @@ class FormatExif { // TODO: YCbCrSubSampling // TODO: YCbCrPositioning - // TODO: If this field does not exists use 2 - case 'ResolutionUnit': #p26 - switch( $val ) { - case 2: case 3: - $tags[$tag] = $this->msg( $tag, $val ); - break; - default: - $tags[$tag] = $val; - break; + + case 'XResolution': + case 'YResolution': + switch( $resolutionunit ) { + case 2: + $tags[$tag] = $this->msg( 'XYResolution', 'i', $this->formatNum( $val ) ); + break; + case 3: + $this->msg( 'XYResolution', 'c', $this->formatNum( $val ) ); + break; + default: + $tags[$tag] = $val; + break; } break; - + // TODO: YCbCrCoefficients #p27 (see annex E) case 'ExifVersion': case 'FlashpixVersion': $tags[$tag] = "$val"/100; -- 2.20.1