summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-30 16:10:09 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-30 16:10:09 +0200
commit109a206ae3f9ce431e3fa24151b75c9bc03065e8 (patch)
treee31d3b25a1c46921c221aea1079b93b5eb04cd38
parent4c912e66db3f60acc2234e9811a4d5f37810a0c8 (diff)
parent96b812bee6884f29b32d678b10cca7737a781b78 (diff)
downloadnextcloud-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.php6
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;