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.
This commit is contained in:
parent
f4e8de3cbb
commit
da0e37ef03
|
@ -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…
Reference in New Issue