-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
refactor: ProductImageData to contain all image links #3088
Merged
monsieurtanuki
merged 12 commits into
openfoodfacts:develop
from
WildOrangutan:2960/image-quality
Oct 12, 2022
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
98a717f
refactor: ProductImageData to contain all image links
WildOrangutan ce5a900
Revert "refactor: ProductImageData to contain all image links"
WildOrangutan faaeadb
refactor: ProductImageData imageUrl to ImageDescriptor
WildOrangutan dd5f9c4
refactor: Move _getProductImageData() to factory method
WildOrangutan 85a2f26
refactor: Revert part of ImageDescriptor changes
WildOrangutan 1014e98
feat: ProductImageData getImageUrl
WildOrangutan ac75b2a
fix: Gallery product image quality
WildOrangutan cf7c9fd
draft: Fallback is full image doesn't exist
WildOrangutan cc2f3a0
revert: Partial revert of fallback draft
WildOrangutan 0f2db3d
feat: Show error when image edit fails
WildOrangutan 2bb8620
fix: Fallback to other image qualities
WildOrangutan 68b8702
fix: Remove other image sizes?
WildOrangutan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
@WildOrangutan So if I sum up, that's where you deduplicate by restricting to
400
pictures only, right?I would rename
_selectProductImage
to_selectBestProductImage
, and/or add a comment.I believe the point of this method should be to take the best picture:
400
, or200
, or100
, and that's not exactly what is in your code (you just say400
or else whatever).Perhaps you could rewrite it in more than one line to make it explicit (we have a method here, we have a bit of space): that would help the code reviewer now (it's me) and whoever will maintain the code later.
You can even write it in one line:
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.
I've updated the code, hope I didn't complicate things to much, by using map.
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.
Also, what about
ORIGINAL
,UNKOWN
ornull
image sizes? Isn't it better for image load too slow, other than not load at all?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.
@WildOrangutan If for some reason we have to download hundreds of "other"
ORIGINAL
, that can be ugly, performance-wise. Could even crash the app I guess.But
400
versions everywhere200
is good enough" or "neverfull
orunknown
").So let's go with it!