Fix warning "Trying to access array offset on value of type bool"

This commit is contained in:
Michael 2024-12-29 15:51:42 +00:00
parent 4917380716
commit b915252e7e
4 changed files with 18 additions and 3 deletions

View file

@ -280,8 +280,8 @@ class Media
// When the original picture is potentially animated but the preview isn't, we override the preview
if (in_array($media['mimetype'] ?? '', ['image/gif', 'image/png']) && !in_array($imagedata['mime'], ['image/gif', 'image/png'])) {
$media['preview'] = $media['url'];
$media['preview-width'] = $media['width'];
$media['preview-height'] = $media['height'];
$media['preview-width'] = $media['width'] ?? $imagedata[0];
$media['preview-height'] = $media['height'] ?? $imagedata[1];
return $media;
}