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:
Thomas Müller 2014-05-12 11:27:39 +02:00
parent f4e8de3cbb
commit da0e37ef03
1 changed files with 5 additions and 4 deletions

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