diff options
-rw-r--r-- | lib/private/preview/image.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php index e8473ebb8a4..2e46e19d706 100644 --- a/lib/private/preview/image.php +++ b/lib/private/preview/image.php @@ -35,12 +35,16 @@ class Image extends Provider { $image = new \OC_Image(); - if($fileInfo['encrypted'] === true) { + $useTempFile = $fileInfo->isEncrypted() || !$fileInfo->getStorage()->isLocal(); + if ($useTempFile) { $fileName = $fileview->toTmpFile($path); } else { $fileName = $fileview->getLocalFile($path); } $image->loadFromFile($fileName); + if ($useTempFile) { + unlink($fileName); + } $image->fixOrientation(); return $image->valid() ? $image : false; |