Browse Source

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.
tags/v7.0.0alpha2
Thomas Müller 10 years ago
parent
commit
da0e37ef03
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      lib/private/preview/image.php

+ 5
- 4
lib/private/preview/image.php View File

@@ -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;
}

Loading…
Cancel
Save