Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

(Room)?Avatar: Request 96x96 avatars on high DPI screens #808

Merged
merged 2 commits into from
Apr 27, 2017

Conversation

superdump
Copy link
Contributor

No description provided.

@superdump superdump requested a review from ara4n April 20, 2017 22:08
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@ara4n
Copy link
Member

ara4n commented Apr 20, 2017

I'm slightly worried about totally ignoring the width & height which was actually requested. Surely we should just be multiplying the size of the image we request from the server by the pixel density of the display? So for a 30px avatar on a 2x display we'd request a 60px image... which synapse would then serve us 96px for anyway, given the next size up from 60px is 96px in the default list of resolutions.

Copy link
Member

@ara4n ara4n left a comment

Choose a reason for hiding this comment

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

let's not ignore the requested width/height, as per comments :)

Multiply the dimension by the device pixel ratio and then round it to
get the width/height of the thumbnail to use in the request.
@superdump
Copy link
Contributor Author

I modified it to use Math.floor(width * window.devicePixelRatio) instead and that works fine.

@ara4n
Copy link
Member

ara4n commented Apr 27, 2017

lgtm - thanks :)

@ara4n ara4n merged commit fc774e8 into develop Apr 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants