Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.php |
— | — | @@ -123,10 +123,9 @@ |
124 | 124 | $wgMediaHandlers['image/tiff'] = 'PagedTiffHandler'; |
125 | 125 | $wgHooks['LanguageGetMagic'][] = 'PagedTiffHandler::addTiffLossyMagicWordLang'; |
126 | 126 | |
127 | | -define('TIFF_METADATA_VERSION', '1.2'); |
| 127 | +define('TIFF_METADATA_VERSION', '1.1'); |
128 | 128 | # 1.0: initial |
129 | 129 | # 1.1: fixed bugs in imageinfo parser |
130 | | -# 1.2: photoshop quirks for imageinfo parser |
131 | 130 | |
132 | 131 | //$wgHooks['PagedTiffHandlerRenderCommand'][] = 'PagedTiffHandler::renderCommand'; |
133 | 132 | //$wgHooks['PagedTiffHandlerTiffData'][] = 'PagedTiffImage::tiffData'; |
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php |
— | — | @@ -225,7 +225,6 @@ |
226 | 226 | $entry = array(); |
227 | 227 | |
228 | 228 | $prevPage = 0; |
229 | | - $quirks = false; |
230 | 229 | |
231 | 230 | foreach ( $rows as $row ) { |
232 | 231 | $row = trim( $row ); |
— | — | @@ -283,37 +282,17 @@ |
284 | 283 | $entry['width'] = (int)$value; |
285 | 284 | } else if ( $key == 'Image Length' || $key == 'PixelYDimension' ) { |
286 | 285 | $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; |
291 | 286 | } |
292 | 287 | } else { |
293 | 288 | // strange line |
294 | 289 | } |
| 290 | + |
295 | 291 | } |
296 | 292 | |
297 | 293 | if ( $entry ) { |
298 | 294 | $ok = $this->addPageEntry($entry, $data, $prevPage); |
299 | 295 | } |
300 | 296 | |
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 | | - |
318 | 297 | if ( !isset( $data['page_amount'] ) ) { |
319 | 298 | $data['page_amount'] = count( $data['page_data'] ); |
320 | 299 | } |