$header['width'] ?? 0, 'height' => $header['height'] ?? 0, 'bits' => 8, 'metadata' => $metadata ]; } /** * Should we refresh the metadata * * @param File $file The file object for the file in question * @return bool|int One of the self::METADATA_(BAD|GOOD|COMPATIBLE) constants */ public function isFileMetadataValid( $file ) { if ( !$file->getMetadataArray() ) { // Old metadata when we just put an empty string in there return self::METADATA_BAD; } return self::METADATA_GOOD; } protected function hasGDSupport() { return false; } /** * Can we render this file? * * Image magick doesn't support indexed xcf files as of current * writing (as of 6.8.9-3) * @param File $file * @return bool */ public function canRender( $file ) { $xcfMeta = $file->getMetadataArray(); if ( isset( $xcfMeta['colorType'] ) && $xcfMeta['colorType'] === 'index-coloured' ) { return false; } return parent::canRender( $file ); } }