aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>2005-07-22 00:55:54 +0000
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>2005-07-22 00:55:54 +0000
commitb928d7f50554577a2cfbe01c17a5cfba1b8bda5b (patch)
tree257b2e396e9fcf06e058a3c23ba8fb8a643068d6
parent722fefedf45a3a0df39ac60871d6739de39ec637 (diff)
downloadmediawikicore-b928d7f50554577a2cfbe01c17a5cfba1b8bda5b.tar.gz
mediawikicore-b928d7f50554577a2cfbe01c17a5cfba1b8bda5b.zip
* No longer displaying ResolutionUnit at all
* Support for [XY]Resolution
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/10235
-rw-r--r--includes/Exif.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/includes/Exif.php b/includes/Exif.php
index 5ee4eabd37c2..7e901759b3ad 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;