needs server to support 1600x1200 thumbnails for retina large ones.
ideally need to cap maximum thumbnail size to 800x600 rather than expand to arbitrary widths.
need to check that luke's funky timeline code doesn't get confused between naturalWidth and infoWidth etc.
also need to consider whether to encode a resolution metric in the event rather than lying about resolution.
This commit is contained in:
Matthew Hodgson 2019-01-14 17:10:20 +00:00
parent 2a20d9d67e
commit 577c411a39
3 changed files with 40 additions and 5 deletions

View file

@ -179,10 +179,16 @@ export default class MImageBody extends React.Component {
// given we deliberately don't thumbnail them serverside to prevent
// billion lol attacks and similar
return this.context.matrixClient.mxcUrlToHttp(
content.info.thumbnail_url, 800, 600,
content.info.thumbnail_url,
800 * window.devicePixelRatio,
600 * window.devicePixelRatio,
);
} else {
return this.context.matrixClient.mxcUrlToHttp(content.url, 800, 600);
return this.context.matrixClient.mxcUrlToHttp(
content.url,
800 * window.devicePixelRatio,
600 * window.devicePixelRatio
);
}
}