diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:10:09 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:10:09 +0200 |
commit | 109a206ae3f9ce431e3fa24151b75c9bc03065e8 (patch) | |
tree | e31d3b25a1c46921c221aea1079b93b5eb04cd38 | |
parent | 4c912e66db3f60acc2234e9811a4d5f37810a0c8 (diff) | |
parent | 96b812bee6884f29b32d678b10cca7737a781b78 (diff) | |
download | nextcloud-server-109a206ae3f9ce431e3fa24151b75c9bc03065e8.tar.gz nextcloud-server-109a206ae3f9ce431e3fa24151b75c9bc03065e8.zip |
Merge pull request #19476 from owncloud/thumbnail-temp-clean-8
[8] Clean temp files used for thumbnail generation
-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; |