This repository was archived by the owner on Jun 9, 2023. It is now read-only.
Don't show too small reddit previews#264
Merged
Tunous merged 3 commits intoTunous:masterfrom Jun 19, 2020
Merged
Conversation
|
|
||
| companion object { | ||
|
|
||
| const val DEFAULT_VIEWER_MIN_WIDTH = 1200 |
Collaborator
Author
There was a problem hiding this comment.
I'm not really sure, maybe this should be lower?
Owner
There was a problem hiding this comment.
Perhaps something like width of screen, or maybe half?
Collaborator
Author
There was a problem hiding this comment.
I've added some logs and checked several random posts - seems like width values are fixed, so I think there's no real need to calculate minWidth, just choose a res which won't be too blurry to look at on average screen. 1200 fits this case pretty well. Using bigger values (including calculated ones) will make data saver useless for, at least, i.redd.it which doesn't provide lowQualityUrl
[Preview 1]
res: 154 x 300
[Preview 1]
res: 154 x 154
res: 330 x 330
res: 500 x 500
res: 1200 x 1200
res: 1700 x 1700
res: 2070 x 2070
[Preview 1]
res: 154 x 121
res: 330 x 242
res: 500 x 360
res: 1200 x 740
res: 1700 x 1320
res: 2070 x 1452
[Preview 1]
res: 154 x 153
res: 330 x 326
res: 500 x 475
res: 1200 x 1173
Tunous
approved these changes
Jun 19, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Sometimes reddit provides only very small previews (around 150x300). With minWidth these can be ignored in normal (non-thumbnail) viewers so they will use lowQualityUrl instead
Example thread: https://old.reddit.com/r/pics/comments/g43i3y/whose_dream_was_it/
(reproducible with data saver enabled in settings)