26use Wikimedia\RequestTimeout\TimeoutException;
37 private const EXPENSIVE_SIZE_LIMIT = 10485760;
51 $tiffThumbnailType = MediaWikiServices::getInstance()->getMainConfig()
52 ->get( MainConfigNames::TiffThumbnailType );
54 return (
bool)$tiffThumbnailType
76 $tiffThumbnailType = MediaWikiServices::getInstance()->getMainConfig()
77 ->get( MainConfigNames::TiffThumbnailType );
79 return $tiffThumbnailType;
83 $showEXIF = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::ShowEXIF );
87 if ( !is_array( $meta ) ) {
89 throw new UnexpectedValueException(
'Metadata array is not an array' );
92 'width' => $meta[
'ImageWidth'] ?? 0,
93 'height' => $meta[
'ImageLength'] ?? 0,
98 $info[
'metadata'] = $meta;
101 }
catch ( TimeoutException $e ) {
103 }
catch ( Exception $e ) {
106 wfDebug( __METHOD__ .
': ' . $e->getMessage() );
113 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.
A foreign repository for a remote MediaWiki accessible through api.php requests.
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.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!is_readable( $file)) $ext