summaryrefslogtreecommitdiffstats
path: root/lib/private/preview
diff options
context:
space:
mode:
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);