mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
fix: handle exif metadata read errors gracefully
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
baf49e3950
commit
94d7e459bc
1 changed files with 4 additions and 3 deletions
|
|
@ -71,8 +71,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],
|
||||
|
|
@ -81,7 +82,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