Skip to content
Snippets Groups Projects
Commit f21ca576 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(housekeeping): set default sizes value + ignore illegal IFD size error to proceed with script

parent 3bfcce37
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,8 @@ class Image extends BaseMedia ...@@ -48,7 +48,8 @@ class Image extends BaseMedia
{ {
parent::setFile($file); parent::setFile($file);
if ($this->file_mimetype === 'image/jpeg' && $metadata = exif_read_data( // @phpstan-ignore-next-line
if ($this->file_mimetype === 'image/jpeg' && $metadata = @exif_read_data(
media_path($this->file_path), media_path($this->file_path),
null, null,
true true
......
...@@ -217,7 +217,10 @@ class SettingsController extends BaseController ...@@ -217,7 +217,10 @@ class SettingsController extends BaseController
} elseif (str_starts_with($image->file_path, 'persons')) { } elseif (str_starts_with($image->file_path, 'persons')) {
$image->sizes = config('Images') $image->sizes = config('Images')
->personAvatarSizes; ->personAvatarSizes;
} else {
$image->sizes = [];
} }
$image->setFile(new File(media_path($image->file_path))); $image->setFile(new File(media_path($image->file_path)));
(new MediaModel('image'))->updateMedia($image); (new MediaModel('image'))->updateMedia($image);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment