Index: trunk/phase3/includes/Exif.php |
— | — | @@ -579,6 +579,9 @@ |
580 | 580 | global $wgLang; |
581 | 581 | |
582 | 582 | $tags =& $this->mExif; |
| 583 | + |
| 584 | + $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3; |
| 585 | + unset( $tags['ResolutionUnit'] ); |
583 | 586 | |
584 | 587 | foreach( $tags as $tag => $val ) { |
585 | 588 | switch( $tag ) { |
— | — | @@ -628,18 +631,22 @@ |
629 | 632 | |
630 | 633 | // TODO: YCbCrSubSampling |
631 | 634 | // 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; |
641 | 648 | } |
642 | 649 | break; |
643 | | - |
| 650 | + |
644 | 651 | // TODO: YCbCrCoefficients #p27 (see annex E) |
645 | 652 | case 'ExifVersion': case 'FlashpixVersion': |
646 | 653 | $tags[$tag] = "$val"/100; |