X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fmedia%2FWebP.php;h=3e4731ae084279383636476f7ba34a837aec2356;hp=35e885f1ca108331c5313ad88526369f262184da;hb=d19826aa35b206847a568a4b2c1c9ffaa615fca5;hpb=f5fc9f21ead83bbc50544772281996f37f64d17c diff --git a/includes/media/WebP.php b/includes/media/WebP.php index 35e885f1ca..3e4731ae08 100644 --- a/includes/media/WebP.php +++ b/includes/media/WebP.php @@ -86,7 +86,7 @@ class WebPHandler extends BitmapHandler { /** * Extracts the image size and WebP type from a file * - * @param string $chunks Chunks as extracted by RiffExtractor + * @param string $filename * @return array|bool Header data array with entries 'compression', 'width' and 'height', * where 'compression' can be 'lossy', 'lossless', 'animated' or 'unknown'. False if * file is not a valid WebP file. @@ -118,6 +118,7 @@ class WebPHandler extends BitmapHandler { /** * Extracts the image size and WebP type from a file based on the chunk list * @param array $chunks Chunks as extracted by RiffExtractor + * @param string $filename * @return array Header data array with entries 'compression', 'width' and 'height', where * 'compression' can be 'lossy', 'lossless', 'animated' or 'unknown' */ @@ -230,7 +231,7 @@ class WebPHandler extends BitmapHandler { if ( $file === null ) { $metadata = self::getMetadata( $file, $path ); } - if ( $metadata === false ) { + if ( $metadata === false && $file instanceof File ) { $metadata = $file->getMetadata(); } @@ -245,7 +246,7 @@ class WebPHandler extends BitmapHandler { } /** - * @param $file + * @param File $file * @return bool True, not all browsers support WebP */ public function mustRender( $file ) { @@ -253,7 +254,7 @@ class WebPHandler extends BitmapHandler { } /** - * @param $file + * @param File $file * @return bool False if we are unable to render this image */ public function canRender( $file ) { @@ -286,9 +287,9 @@ class WebPHandler extends BitmapHandler { /** * Render files as PNG * - * @param $ext - * @param $mime - * @param $params + * @param string $ext + * @param string $mime + * @param array|null $params * @return array */ public function getThumbType( $ext, $mime, $params = null ) {