From: Aaron Schulz Date: Thu, 23 Aug 2012 04:13:40 +0000 (-0700) Subject: Fixed streaming for thumbs that are already in storage. X-Git-Tag: 1.31.0-rc.0~22624 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=ed9d124c37f57ab7d7c9678908af54363290b1f4;p=lhc%2Fweb%2Fwiklou.git Fixed streaming for thumbs that are already in storage. Change-Id: Iafbd5c435a5d63738a43f1ac4e52e6c4148d6784 --- 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 ); + } } /**