r77364 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77363‎ | r77364 | r77365 >
Date:18:51, 27 November 2010
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
(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()
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/File.php
@@ -1049,7 +1049,7 @@
10501050 }
10511051
10521052 /**
1053 - * Returns the number of pages of a multipage document, or NULL for
 1053+ * Returns the number of pages of a multipage document, or false for
10541054 * documents which aren't multipage documents
10551055 */
10561056 function pageCount() {
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -230,6 +230,11 @@
231231 $vals['size'] = intval( $file->getSize() );
232232 $vals['width'] = intval( $file->getWidth() );
233233 $vals['height'] = intval( $file->getHeight() );
 234+
 235+ $pageCount = $file->pageCount();
 236+ if ( $pageCount !== false ) {
 237+ $vals['pagecount'] = $pageCount;
 238+ }
234239 }
235240 if ( isset( $prop['url'] ) ) {
236241 if ( !is_null( $scale ) && !$file->isOld() ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -537,6 +537,8 @@
538538 * (bug 26006) prop=langlinks now allows obtaining full URL
539539 * (bug 26075) ApiDelete.php now calls correctly ArticleDelete hook
540540 * (bug 26089) add block expiration to blockinfo
 541+* (bug 26125) prop=imageinfo&iiprop=size now returns the page count if the
 542+ file is a multi-page file
541543
542544 === Languages updated in 1.17 ===
543545

Follow-up revisions

RevisionCommit summaryAuthorDate
r82477* (bug 27554) Update api information text to reflect change in bug 26125reedy19:52, 19 February 2011

Comments

#Comment by TheDJ (talk | contribs)   08:34, 1 December 2010

no intval() here ?

#Comment by Bryan (talk | contribs)   09:27, 1 December 2010

According to the docs pageCount() always returns an int.

Status & tagging log