From: Gilles Dubuc Date: Fri, 28 Mar 2014 08:33:02 +0000 (+0100) Subject: Expose thumbnail file to extensions X-Git-Tag: 1.31.0-rc.0~16423^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=29044d760f97333dfc3f6f94a8aa8e570ece8624;p=lhc%2Fweb%2Fwiklou.git Expose thumbnail file to extensions This is needed by Media Viewer in order to display a placeholder image as soon as possible See https://gerrit.wikimedia.org/r/#/c/121613/ Change-Id: I3dfa80b02073984dc2d3d7784cb3744b7e4e2cc8 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/293 --- diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 41b09e6b48..05feb3043c 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -70,6 +70,13 @@ abstract class MediaTransformOutput { return $this->height; } + /** + * @return File file + */ + public function getFile() { + return $this->file; + } + /** * Get the final extension of the thumbnail. * Returns false for scripted transformations. @@ -374,6 +381,7 @@ class ThumbnailImage extends MediaTransformOutput { 'alt' => $alt, 'src' => $this->url, ); + if ( empty( $options['no-dimensions'] ) ) { $attribs['width'] = $this->width; $attribs['height'] = $this->height;