From 29044d760f97333dfc3f6f94a8aa8e570ece8624 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Fri, 28 Mar 2014 09:33:02 +0100 Subject: [PATCH] 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 --- includes/media/MediaTransformOutput.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.20.1