Merge pull request #19471 from owncloud/thumbnail-temp-clean
Clean temp files used for thumbnail generation
This commit is contained in:
commit
e294033f31
|
@ -46,12 +46,16 @@ abstract class Image extends Provider {
|
||||||
|
|
||||||
$image = new \OC_Image();
|
$image = new \OC_Image();
|
||||||
|
|
||||||
if ($fileInfo['encrypted'] === true) {
|
$useTempFile = $fileInfo->isEncrypted() || !$fileInfo->getStorage()->isLocal();
|
||||||
|
if ($useTempFile) {
|
||||||
$fileName = $fileview->toTmpFile($path);
|
$fileName = $fileview->toTmpFile($path);
|
||||||
} else {
|
} else {
|
||||||
$fileName = $fileview->getLocalFile($path);
|
$fileName = $fileview->getLocalFile($path);
|
||||||
}
|
}
|
||||||
$image->loadFromFile($fileName);
|
$image->loadFromFile($fileName);
|
||||||
|
if ($useTempFile) {
|
||||||
|
unlink($fileName);
|
||||||
|
}
|
||||||
$image->fixOrientation();
|
$image->fixOrientation();
|
||||||
if ($image->valid()) {
|
if ($image->valid()) {
|
||||||
$image->scaleDownToFit($maxX, $maxY);
|
$image->scaleDownToFit($maxX, $maxY);
|
||||||
|
|
Loading…
Reference in New Issue