Expose thumbnail file to extensions
authorGilles Dubuc <gdubuc@wikimedia.org>
Fri, 28 Mar 2014 08:33:02 +0000 (09:33 +0100)
committerGilles Dubuc <gdubuc@wikimedia.org>
Fri, 28 Mar 2014 10:09:36 +0000 (11:09 +0100)
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

index 41b09e6..05feb30 100644 (file)
@@ -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;