do not fail if size metadata for an image fail#38011
Closed
Conversation
some images may trigger an exception when trying to get their size Signed-off-by: Matthieu Gallien <[email protected]>
8dd1da6 to
9e5521f
Compare
Pytal
approved these changes
May 1, 2023
solracsf
approved these changes
May 2, 2023
Contributor
|
Isnt #37944 the better approach? |
kesselb
reviewed
May 2, 2023
| $sizeResult = getimagesizefromstring($file->getContent()); | ||
| try { | ||
| $sizeResult = getimagesizefromstring($file->getContent()); | ||
| } catch (\Exception $ex) { |
Contributor
There was a problem hiding this comment.
Suggested change
| } catch (\Exception $ex) { | |
| } catch (\TypeError $ex) { |
As per php/php-src@b9171d8
Contributor
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. |
kesselb
approved these changes
May 2, 2023
come-nc
requested changes
May 2, 2023
Contributor
come-nc
left a comment
There was a problem hiding this comment.
We should not catch TypeError like this
Contributor
|
@mgallien What is the trace of the error you are trying to fix? |
Merged
JuliaKirschenheuter
approved these changes
May 3, 2023
Contributor
Author
|
@come-nc see |
Contributor
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-metadatafor some imagesChecklist