-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do not fail if size metadata for an image fail #38011
Conversation
some images may trigger an exception when trying to get their size Signed-off-by: Matthieu Gallien <[email protected]>
8dd1da6
to
9e5521f
Compare
Isnt #37944 the better approach? |
$sizeResult = getimagesizefromstring($file->getContent()); | ||
try { | ||
$sizeResult = getimagesizefromstring($file->getContent()); | ||
} catch (\Exception $ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} catch (\Exception $ex) { | |
} catch (\TypeError $ex) { |
As per php/php-src@b9171d8
Both make sense. The execute method has a proper error handling already. PHP 8 behaves different and throws an exception, but returned false for earlier versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not catch TypeError like this
@mgallien What is the trace of the error you are trying to fix? |
@come-nc see
|
some images may trigger an exception when trying to get their size
Signed-off-by: Matthieu Gallien [email protected]
fix for a blocking exception when running
occ files:scan --generate-metadata
for some imagesChecklist