38 private const EXPENSIVE_SIZE_LIMIT = 10_485_760;
52 $tiffThumbnailType = MediaWikiServices::getInstance()->getMainConfig()
53 ->get( MainConfigNames::TiffThumbnailType );
55 return (
bool)$tiffThumbnailType
77 $tiffThumbnailType = MediaWikiServices::getInstance()->getMainConfig()
78 ->get( MainConfigNames::TiffThumbnailType );
80 return $tiffThumbnailType;
84 $showEXIF = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::ShowEXIF );
88 if ( !is_array( $meta ) ) {
93 'width' => $meta[
'ImageWidth'] ?? 0,
94 'height' => $meta[
'ImageLength'] ?? 0,
99 $info[
'metadata'] = $meta;
105 wfDebug( __METHOD__ .
': ' . $e->getMessage() );
112 return $file->getSize() > static::EXPENSIVE_SIZE_LIMIT;
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Stuff specific to JPEG and (built-in) TIFF handler.
applyExifRotation( $info, $metadata)
const BROKEN_FILE
Error extracting metadata.
static version()
The version of the output format.
A class containing constants representing the names of configuration variables.
isExpensiveToThumbnail( $file)
True if creating thumbnails from the file is large or otherwise resource-intensive.
getThumbType( $ext, $mime, $params=null)
canRender( $file)
Conversion to PNG for inline display can be disabled here... Note scaling should work with ImageMagic...
mustRender( $file)
Browsers don't support TIFF inline generally... For inline display, we need to convert to PNG.
getSizeAndMetadata( $state, $filename)
Get image size information and metadata array.