summaryrefslogtreecommitdiffstats
path: root/lib/private/preview
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-12 11:27:39 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-05-12 11:27:39 +0200
commitda0e37ef0372b29bd0780709e3cf9d3c715ee63f (patch)
tree459af66123cafc6ce0a649b8cef79f8bea5def78 /lib/private/preview
parentf4e8de3cbbf426e7b22d5100085626b2e4fefc29 (diff)
downloadnextcloud-server-da0e37ef0372b29bd0780709e3cf9d3c715ee63f.tar.gz
nextcloud-server-da0e37ef0372b29bd0780709e3cf9d3c715ee63f.zip
Rotate thumbnail when encryption is enabled
When a picture is encrypted, save it to a temporary file first so that the PHP function for rotation can access it as file.
Diffstat (limited to 'lib/private/preview')
-rw-r--r--lib/private/preview/image.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index 59aaa27ef34..cec5d7c0170 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -22,12 +22,13 @@ class Image extends Provider {
}
$image = new \OC_Image();
- //check if file is encrypted
+
if($fileInfo['encrypted'] === true) {
- $image->loadFromData(stream_get_contents($fileview->fopen($path, 'r')));
- }else{
- $image->loadFromFile($fileview->getLocalFile($path));
+ $fileName = $fileview->toTmpFile($path);
+ } else {
+ $fileName = $fileview->getLocalFile($path);
}
+ $image->loadFromFile($fileName);
return $image->valid() ? $image : false;
}