jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/340898 )

Change subject: Return "duration" and "size" for imageinfo requests
......................................................................


Return "duration" and "size" for imageinfo requests

 * Matches core commit 84d8b18b

Change-Id: I41cca6c6e2a3d96f75371f7276e00d0be52ae327
---
M includes/ApiParsoidBatch.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ApiParsoidBatch.php b/includes/ApiParsoidBatch.php
index a8460aa..1f3cb80 100644
--- a/includes/ApiParsoidBatch.php
+++ b/includes/ApiParsoidBatch.php
@@ -275,13 +275,17 @@
                $result = array(
                        'width' => $file->getWidth(),
                        'height' => $file->getHeight(),
+                       'size' => $file->getSize(),
                        'mediatype' => $file->getMediaType(),
                        'mime' => $file->getMimeType(),
                        'url' => wfExpandUrl( $file->getFullUrl(), 
PROTO_CURRENT ),
                        'mustRender' => $file->mustRender(),
                        'badFile' => wfIsBadImage( $filename, $page ?: false ),
                );
-
+               $length = $file->getLength();
+               if ( $length ) {
+                       $result['duration'] = (float)$length;
+               }
                $txopts = $this->makeTransformOptions( $file, $txopts );
                $mto = $file->transform( $txopts );
                if ( $mto ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/340898
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I41cca6c6e2a3d96f75371f7276e00d0be52ae327
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParsoidBatchAPI
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to