Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Conversation

@AbsurdlySuspicious
Copy link
Collaborator

@AbsurdlySuspicious AbsurdlySuspicious commented Jun 17, 2020

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)


companion object {

const val DEFAULT_VIEWER_MIN_WIDTH = 1200
Copy link
Collaborator Author

@AbsurdlySuspicious AbsurdlySuspicious Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure, maybe this should be lower?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps something like width of screen, or maybe half?

Copy link
Collaborator Author

@AbsurdlySuspicious AbsurdlySuspicious Jun 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Tunous merged commit 74c15fc into Tunous:master Jun 19, 2020
@Tunous Tunous added this to the 0.9.3 milestone Jun 19, 2020
@Tunous Tunous added the bug Something isn't working label Jun 19, 2020
@AbsurdlySuspicious AbsurdlySuspicious deleted the reddit_previews/feature branch June 21, 2020 13:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants