Merge pull request #19471 from owncloud/thumbnail-temp-clean

Clean temp files used for thumbnail generation
This commit is contained in:
Thomas Müller 2015-09-30 14:38:02 +02:00
commit e294033f31

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