From ed9d124c37f57ab7d7c9678908af54363290b1f4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 22 Aug 2012 21:13:40 -0700 Subject: [PATCH] Fixed streaming for thumbs that are already in storage. Change-Id: Iafbd5c435a5d63738a43f1ac4e52e6c4148d6784 --- includes/media/MediaTransformOutput.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 80766bb3b9..cee5bbf23a 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -157,7 +157,14 @@ abstract class MediaTransformOutput { * @return Bool success */ public function streamFile( $headers = array() ) { - return $this->path && StreamFile::stream( $this->getLocalCopyPath(), $headers ); + if ( !$this->path ) { + return false; + } elseif ( FileBackend::isStoragePath( $this->path ) ) { + $be = $this->file->getRepo()->getBackend(); + return $be->streamFile( array( 'src' => $this->path, 'headers' => $headers ) )->isOK(); + } else { // FS-file + return StreamFile::stream( $this->getLocalCopyPath(), $headers ); + } } /** -- 2.20.1