X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FMediaHandler.php;h=2e8d41dee4eb30633a6aad75d9d0f13b3d1c0012;hb=f10c9815e69b59844c178d218640bd1ac0435896;hp=3204fd7b49858e29c5c71f94cf2eede7c1fd9c45;hpb=3dbc5ec92d244d421e9a8799efda534cac360759;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 3204fd7b49..2e8d41dee4 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -332,18 +332,28 @@ abstract class MediaHandler { * Get an associative array of page dimensions * Currently "width" and "height" are understood, but this might be * expanded in the future. - * Returns false if unknown or if the document is not multi-page. + * Returns false if unknown. + * + * It is expected that handlers for paged media (e.g. DjVuHandler) + * will override this method so that it gives the correct results + * for each specific page of the file, using the $page argument. + * + * @note For non-paged media, use getImageSize. * * @param $image File - * @param $page Unused, left for backcompatibility? - * @return array + * @param $page What page to get dimensions of + * @return array|bool */ function getPageDimensions( $image, $page ) { $gis = $this->getImageSize( $image, $image->getLocalRefPath() ); - return array( - 'width' => $gis[0], - 'height' => $gis[1] - ); + if ( $gis ) { + return array( + 'width' => $gis[0], + 'height' => $gis[1] + ); + } else { + return false; + } } /**