Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
su-ex opened this issue Aug 18, 2021 · 7 comments
Labels
A-Media A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect X-Regression

Comments

@su-ex
Copy link

su-ex commented Aug 18, 2021

Steps to reproduce

As of matrix-org/matrix-react-sdk@7b6536c#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
Bildschirmfoto von 2021-08-18 12-39-09

What did you expect?

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

@su-ex su-ex added the T-Defect label Aug 18, 2021
@SimonBrandner SimonBrandner added A-Media A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround X-Regression labels Aug 18, 2021
@su-ex su-ex changed the title Some clients send out swapped out w/h with exif rotated images and thus css aspect-ratio has swapped out w/h Some clients send swapped out w/h with exif rotated images and thus css has swapped out w/h Aug 18, 2021
@dbkr
Copy link
Member

dbkr commented Aug 18, 2021

I'm finding it a bit hard to tell but it looks like the image has been cropped - is that what's being demonstrated here? Probably we should letterbox it within the advertised container size?

@dbkr dbkr added the X-Needs-Info This issue is blocked awaiting information from the reporter label Aug 18, 2021
@su-ex
Copy link
Author

su-ex commented Aug 18, 2021

Before the mentionend commit it has been cropped, now it's size reduced and not well aligned.
In each of the screenshots is the second image the one with the swapped w/h.

@dbkr dbkr mentioned this issue Aug 18, 2021
@su-ex
Copy link
Author

su-ex commented Aug 18, 2021

This is the timeline before the aforementioned commit:
Bildschirmfoto von 2021-08-18 17-43-02_2

@dbkr
Copy link
Member

dbkr commented Aug 18, 2021

Reducing the size of the image seems to me to be a better way to handle this than cropping it though?

@su-ex
Copy link
Author

su-ex commented Aug 18, 2021

Well, this doesn't change that it's misaligned.
This is fine while the image is not loaded, but it should be properly aligned when it is loaded.

@dbkr dbkr changed the title Some clients send swapped out w/h with exif rotated images and thus css has swapped out w/h Images with incorrect size metadata are displayed on the right hand side of the screen Aug 19, 2021
@dbkr
Copy link
Member

dbkr commented Aug 19, 2021

OK - I've tried to update the description to reflect the problem, although still not really sure I've got it right. In particular with message bubbles - if your first screenshot is with message bubbles then it looks like the image is in the centre of the bubble which seems reasonable?

@su-ex
Copy link
Author

su-ex commented Aug 19, 2021

Yes, "incorrect metadata" probably fits best because it's likely still an issue when w and/or h are just plainly wrong instead of just swapped.
With the second part – I think I can't agree. It depends on the surrounding layout how it will look in the end.
I'd suggest "Images with incorrect (w/h) metadata should correct their depiction (in the timeline) once the image has actually been loaded" (I've avoided "size" as this is also a property of the metadata but can be ignored here).

@su-ex su-ex changed the title Images with incorrect size metadata are displayed on the right hand side of the screen Images with incorrect metadata should correct their depiction in the timeline once the image has actually been loaded Sep 8, 2021
@turt2live turt2live removed the X-Needs-Info This issue is blocked awaiting information from the reporter label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Media A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect X-Regression
Projects
None yet
Development

No branches or pull requests

4 participants