r72370 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72369‎ | r72370 | r72371 >
Date:12:22, 4 September 2010
Author:daniel
Status:ok
Tags:
Comment:
revert for r72279: photoshop quirks to be replaced by generic handling of EXIF-IFDs, etc
Modified paths:
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php (modified) (history)
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.php
@@ -123,10 +123,9 @@
124124 $wgMediaHandlers['image/tiff'] = 'PagedTiffHandler';
125125 $wgHooks['LanguageGetMagic'][] = 'PagedTiffHandler::addTiffLossyMagicWordLang';
126126
127 -define('TIFF_METADATA_VERSION', '1.2');
 127+define('TIFF_METADATA_VERSION', '1.1');
128128 # 1.0: initial
129129 # 1.1: fixed bugs in imageinfo parser
130 -# 1.2: photoshop quirks for imageinfo parser
131130
132131 //$wgHooks['PagedTiffHandlerRenderCommand'][] = 'PagedTiffHandler::renderCommand';
133132 //$wgHooks['PagedTiffHandlerTiffData'][] = 'PagedTiffImage::tiffData';
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
@@ -225,7 +225,6 @@
226226 $entry = array();
227227
228228 $prevPage = 0;
229 - $quirks = false;
230229
231230 foreach ( $rows as $row ) {
232231 $row = trim( $row );
@@ -283,37 +282,17 @@
284283 $entry['width'] = (int)$value;
285284 } else if ( $key == 'Image Length' || $key == 'PixelYDimension' ) {
286285 $entry['height'] = (int)$value;
287 - } else if ( $key == 'Software' && preg_match('/photoshop/i', $value) ) {
288 - $quirks = "photoshop";
289 - } else if ( $key == 'Subfile Type' ) {
290 - $entry['type'] = (int)$value;
291286 }
292287 } else {
293288 // strange line
294289 }
 290+
295291 }
296292
297293 if ( $entry ) {
298294 $ok = $this->addPageEntry($entry, $data, $prevPage);
299295 }
300296
301 - if ( $quirks === 'photoshop' && count( $data['page_data'] ) > 1 ) {
302 - # Photoshop may use multiple directories for a single page image
303 - # Ignore the ones with SubfileType == 0
304 - foreach ( $data['page_data'] as $i => $entry ) {
305 - if ( isset($entry['type']) && $entry['type'] === 0 ) {
306 - unset( $data['page_data'][$i] );
307 - $data['warnings'][] = "removed spurious frame (photoshop quirk)";
308 - }
309 - }
310 -
311 - $data['page_data'] = array_values( $data['page_data'] ); # re-index
312 - array_unshift( $data['page_data'], null ); # make 1-indexed
313 - unset( $data['page_data'][0] ); #remove dummy
314 - }
315 -
316 - $data['quirks'] = $quirks;
317 -
318297 if ( !isset( $data['page_amount'] ) ) {
319298 $data['page_amount'] = count( $data['page_data'] );
320299 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72279photoshop quirks: ignore extra tiff directory causing the same data to show a...daniel12:06, 3 September 2010

Status & tagging log