diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-30 14:07:59 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-09-30 14:07:59 +0200 |
commit | a2817372ad89b11ef382845540068b016286d046 (patch) | |
tree | 8d7c14ebe7ca86f8dfcbd09a0e818ac427b8b6a6 /lib/private/preview | |
parent | 6d743ffac6ceb2b89447e7a7da6fdbefc4a6d06a (diff) | |
download | nextcloud-server-a2817372ad89b11ef382845540068b016286d046.tar.gz nextcloud-server-a2817372ad89b11ef382845540068b016286d046.zip |
Clean temp files used for thumbnail generation
Diffstat (limited to 'lib/private/preview')
-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 f9c27e690f6..fd90b15eb0c 100644 --- a/lib/private/preview/image.php +++ b/lib/private/preview/image.php @@ -46,12 +46,16 @@ abstract 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(); if ($image->valid()) { $image->scaleDownToFit($maxX, $maxY); |