mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: handle exif metadata read errors gracefully
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
af003304c0
commit
84408cdc28
1 changed files with 4 additions and 3 deletions
|
|
@ -67,8 +67,9 @@ class ExifProvider implements IMetadataProvider {
|
|||
$size->setId($file->getId());
|
||||
$size->setArrayAsValue([]);
|
||||
|
||||
if (!$data) {
|
||||
$sizeResult = getimagesizefromstring($file->getContent());
|
||||
$content = $file->getContent();
|
||||
if (!$data && $content) {
|
||||
$sizeResult = getimagesizefromstring($content);
|
||||
if ($sizeResult !== false) {
|
||||
$size->setArrayAsValue([
|
||||
'width' => $sizeResult[0],
|
||||
|
|
@ -77,7 +78,7 @@ class ExifProvider implements IMetadataProvider {
|
|||
|
||||
$exifData['size'] = $size;
|
||||
}
|
||||
} elseif (array_key_exists('COMPUTED', $data)) {
|
||||
} elseif ($data && array_key_exists('COMPUTED', $data)) {
|
||||
if (array_key_exists('Width', $data['COMPUTED']) && array_key_exists('Height', $data['COMPUTED'])) {
|
||||
$size->setArrayAsValue([
|
||||
'width' => $data['COMPUTED']['Width'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue