Made sure MediaTransformOutput::getLocalCopyPath handles storage paths.

* Storage paths are passed in for several cases in File::transform().

Change-Id: I61a4058b80a37f36b78e2dfe62ffdf6f73e6f41e
This commit is contained in:
Aaron Schulz 2013-03-27 12:48:08 -07:00
parent b3c718f6ae
commit cfe057a603
2 changed files with 7 additions and 3 deletions

View file

@ -910,8 +910,7 @@ abstract class File {
// XXX: Pass in the storage path even though we are not rendering anything
// and the path is supposed to be an FS path. This is due to getScalerType()
// getting called on the path and clobbering $thumb->getUrl() if it's false.
$thumb = $handler->getTransform(
$this, $thumbPath, $thumbUrl, $params );
$thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
$thumb->setStoragePath( $thumbPath );
break;
}

View file

@ -151,7 +151,12 @@ abstract class MediaTransformOutput {
if ( $this->isError() ) {
return false;
} elseif ( $this->path === null ) {
return $this->file->getLocalRefPath();
return $this->file->getLocalRefPath(); // assume thumb was not scaled
} elseif ( FileBackend::isStoragePath( $this->path ) ) {
$be = $this->file->getRepo()->getBackend();
// The temp file will be process cached by FileBackend
$fsFile = $be->getLocalReference( array( 'src' => $this->path ) );
return $fsFile ? $fsFile->getPath() : false;
} else {
return $this->path; // may return false
}