From: Aaron Schulz Date: Tue, 13 May 2014 23:07:15 +0000 (-0700) Subject: Fixed "file already exist" optimization in File::transform() X-Git-Tag: 1.31.0-rc.0~15706^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=5255476305457d7a26899f50d749f1316a493d9a;p=lhc%2Fweb%2Fwiklou.git Fixed "file already exist" optimization in File::transform() * Previously, the resulting thumbnail did not handle hasFile() and stream() properly. This effected doCachedWork() in thumb.php Change-Id: I8fd025204b5b41472be6c09924892fe8ee9dd260 --- diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 99eca62f8a..d8d56a4da9 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -106,6 +106,9 @@ abstract class MediaTransformOutput { */ public function setStoragePath( $storagePath ) { $this->storagePath = $storagePath; + if ( $this->path === false ) { + $this->path = $storagePath; + } } /** @@ -140,9 +143,12 @@ abstract class MediaTransformOutput { /** * Check if an output thumbnail file actually exists. + * * This will return false if there was an error, the * thumbnail is to be handled client-side only, or if * transformation was deferred via TRANSFORM_LATER. + * This file may exist as a new file in /tmp, a file + * in permanent storage, or even refer to the original. * * @return bool */