diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-30 14:07:59 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-09-30 15:18:02 +0200 |
commit | 96b812bee6884f29b32d678b10cca7737a781b78 (patch) | |
tree | e31d3b25a1c46921c221aea1079b93b5eb04cd38 /lib | |
parent | 4c912e66db3f60acc2234e9811a4d5f37810a0c8 (diff) | |
download | nextcloud-server-96b812bee6884f29b32d678b10cca7737a781b78.tar.gz nextcloud-server-96b812bee6884f29b32d678b10cca7737a781b78.zip |
Clean temp files used for thumbnail generation
Diffstat (limited to 'lib')
-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; |