(bug 26125) prop=imageinfo&iiprop=size now returns the page count if the file is...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 27 Nov 2010 18:51:17 +0000 (18:51 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 27 Nov 2010 18:51:17 +0000 (18:51 +0000)
Also fix blatant lie in File::pageCount()

RELEASE-NOTES
includes/api/ApiQueryImageInfo.php
includes/filerepo/File.php

index 7a237c2..8959b6b 100644 (file)
@@ -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 ===
 
index 11ec5e0..187e65f 100644 (file)
@@ -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() ) {
index 0ba402f..65d7e79 100644 (file)
@@ -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() {