Clean temp files used for thumbnail generation

This commit is contained in:
Robin Appelman 2015-09-30 14:07:59 +02:00
parent 6d743ffac6
commit a2817372ad
1 changed files with 5 additions and 1 deletions

View File

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