Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php |
— | — | @@ -610,9 +610,15 @@ |
611 | 611 | return false; |
612 | 612 | } |
613 | 613 | unset( $exif['MEDIAWIKI_EXIF_VERSION'] ); |
614 | | - $format = new FormatExif( $exif ); |
| 614 | + if ( class_exists( 'FormatMetadata' ) ) { |
| 615 | + // 1.18+ |
| 616 | + $formatted = FormatMetadata::getFormattedData( $exif ); |
| 617 | + } else { |
| 618 | + // 1.17 and earlier. |
| 619 | + $format = new FormatExif( $exif ); |
615 | 620 | |
616 | | - $formatted = $format->getFormattedData(); |
| 621 | + $formatted = $format->getFormattedData(); |
| 622 | + } |
617 | 623 | // Sort fields into visible and collapsed |
618 | 624 | $visibleFields = $this->visibleMetadataFields(); |
619 | 625 | foreach ( $formatted as $name => $value ) { |
— | — | @@ -621,7 +627,7 @@ |
622 | 628 | in_array( $tag, $visibleFields ) ? 'visible' : 'collapsed', |
623 | 629 | 'exif', |
624 | 630 | $tag, |
625 | | - htmlspecialchars( $value ) |
| 631 | + $value |
626 | 632 | ); |
627 | 633 | } |
628 | 634 | $meta = unserialize( $metadata ); |
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php |
— | — | @@ -170,8 +170,14 @@ |
171 | 171 | $this->_meta['exif'] = $data; |
172 | 172 | } elseif ( $wgShowEXIF ) { |
173 | 173 | wfDebug( __METHOD__ . ": using internal Exif( {$this->mFilename} )\n" ); |
174 | | - $exif = new Exif( $this->mFilename ); |
175 | | - $data = $exif->getFilteredData(); |
| 174 | + if ( method_exists( 'BitmapMetadataHandler', 'Tiff' ) ) { |
| 175 | + $data = BitmapMetadataHandler::Tiff( $this->mFilename ); |
| 176 | + } else { |
| 177 | + // old method for back compat. |
| 178 | + $exif = new Exif( $this->mFilename ); |
| 179 | + $data = $exif->getFilteredData(); |
| 180 | + } |
| 181 | + |
176 | 182 | if ( $data ) { |
177 | 183 | $data['MEDIAWIKI_EXIF_VERSION'] = Exif::version(); |
178 | 184 | $this->_meta['exif'] = $data; |
— | — | @@ -493,4 +499,4 @@ |
494 | 500 | function hasErrors() { |
495 | 501 | return !empty( $this->metadata['errors'] ); |
496 | 502 | } |
497 | | -} |
\ No newline at end of file |
| 503 | +} |