Merge "API: Improve handling of interwiki redirects when resolving"
[lhc/web/wiklou.git] / includes / media / Tiff.php
index 6964170..bea6cab 100644 (file)
@@ -27,6 +27,8 @@
  * @ingroup Media
  */
 class TiffHandler extends ExifBitmapHandler {
+       const EXPENSIVE_SIZE_LIMIT = 10485760; // TIFF files over 10M are considered expensive to thumbnail
+
        /**
         * Conversion to PNG for inline display can be disabled here...
         * Note scaling should work with ImageMagick, but may not with GD scaling.
@@ -97,4 +99,8 @@ class TiffHandler extends ExifBitmapHandler {
                        return '';
                }
        }
+
+       public function isExpensiveToThumbnail( $file ) {
+               return $file->getSize() > static::EXPENSIVE_SIZE_LIMIT;
+       }
 }