Merge pull request #19471 from owncloud/thumbnail-temp-clean
Clean temp files used for thumbnail generation
This commit is contained in:
commit
e294033f31
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue