element-hq / element-hq/element-web

Images with incorrect metadata should correct their depiction in the timeline once the image has actually been loaded

Open
#18,616 7 comments 0 reactions 0 assignees View on GitHub
A-Media A-Timeline O-Uncommon S-Major T-Defect X-Regression
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

As of https://github.com/matrix-org/matrix-react-sdk/commit/7b6536c297fbd44ab6cd1b66ce71d99c790852f7#diff-265bce8083cb791022167e130a59ebba99e3e974d9d3120f953ed41461b0f22a (edit: this was also a problem before with `max-width` and `max-height` in the same line **which led to cut images**) there's a problem with some exif rotated images due to the aspect-ratio and some clients sending swapped out w/h which makes css `aspect-ratio` have swapped w/h:

Some clients:
```
"content": {
"body": "left.jpg",
"info": {
"size": 3874,
"mimetype": "image/jpeg",
"w": 480,
"h": 640,
"xyz.amorgan.blurhash": "T3TI,axu~qofj[t7~qof00-;ayM{"
},
"msgtype": "m.image",
"url": "mxc://supercable.onl/UIEMyFcdPHvVWaCpOScbCOuk"
}
```

Other clients with swapped out w/h:
```
"content": {
"body": "left.jpg",
"info": {
"size": 3874,
"mimetype": "image/jpeg",
"w": 640,
"h": 480,
"xyz.amorgan.blurhash": "T3TI,axu~qofj[t7~qof00-;ayM{"
},
"msgtype": "m.image",
"url": "mxc://supercable.onl/UIEMyFcdPHvVWaCpOScbCOuk"
}
```

### What happened?

![Bildschirmfoto von 2021-08-18 12-35-19](https://user-images.githubusercontent.com/9221456/129884909-8bc8cd43-3f8c-4954-9b7e-20d0ffcc9a84.png)
![Bildschirmfoto von 2021-08-18 12-39-09](https://user-images.githubusercontent.com/9221456/129885004-5ceeaa51-8079-44c7-8462-896bcd5b925f.png)

### What did you expect?

Right css `aspect-ratio`, at least after image has been loaded.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.