From 3406091152693490c284ba7d2aecf3c6bff29d9f Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 27 Nov 2010 18:51:17 +0000 Subject: [PATCH] (bug 26125) prop=imageinfo&iiprop=size now returns the page count if the file is a multi-page file Also fix blatant lie in File::pageCount() --- RELEASE-NOTES | 2 ++ includes/api/ApiQueryImageInfo.php | 5 +++++ includes/filerepo/File.php | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7a237c21f1..8959b6b5c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -537,6 +537,8 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 26006) prop=langlinks now allows obtaining full URL * (bug 26075) ApiDelete.php now calls correctly ArticleDelete hook * (bug 26089) add block expiration to blockinfo +* (bug 26125) prop=imageinfo&iiprop=size now returns the page count if the + file is a multi-page file === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 11ec5e07c1..187e65fe68 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -230,6 +230,11 @@ class ApiQueryImageInfo extends ApiQueryBase { $vals['size'] = intval( $file->getSize() ); $vals['width'] = intval( $file->getWidth() ); $vals['height'] = intval( $file->getHeight() ); + + $pageCount = $file->pageCount(); + if ( $pageCount !== false ) { + $vals['pagecount'] = $pageCount; + } } if ( isset( $prop['url'] ) ) { if ( !is_null( $scale ) && !$file->isOld() ) { diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 0ba402f091..65d7e79a0a 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -1049,7 +1049,7 @@ abstract class File { } /** - * Returns the number of pages of a multipage document, or NULL for + * Returns the number of pages of a multipage document, or false for * documents which aren't multipage documents */ function pageCount() { -- 2.20.1