aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/preview
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-30 14:07:59 +0200
committerRobin Appelman <icewind@owncloud.com>2015-09-30 14:07:59 +0200
commita2817372ad89b11ef382845540068b016286d046 (patch)
tree8d7c14ebe7ca86f8dfcbd09a0e818ac427b8b6a6 /lib/private/preview
parent6d743ffac6ceb2b89447e7a7da6fdbefc4a6d06a (diff)
downloadnextcloud-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.php6
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);