element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.26k stars 2.01k forks source link

Image viewer doesn't show images unscaled when zooming in via mouse click #20400

Open AgentOak opened 2 years ago

AgentOak commented 2 years ago

Steps to reproduce

I'm using this image for testing: test_image (from here)

  1. Post an image into any chat
  2. Have your chat window be smaller than the image
  3. Then click on the image to open it in the image viewer
  4. It is scaled down to fit the window, which is OK
  5. Click on the image to enlarge it

Outcome

What did you expect?

Shows the picture unscaled, i.e. pixel-perfect mapping from image pixels to device pixels.

This is what the image looks like unscaled, when the element window is big enough to fit it (may need to open in a new tab to see unscaled):

bigwindow_unscaled

What happened instead?

The picture got bigger but is still scaled as is evident from the blurry text.

smallwindow_scaled

Interestingly this only affects zooming via mouse click. If you close and open the image viewer again, and this time use the "Zoom in" button at the top a couple of times, eventually the image will be unscaled.

Operating system

Windows 10

Application version

Element version: 1.9.8 Olm version: 3.2.8

How did you install the app?

https://element.io/get-started#download

Homeserver

No response

Will you send logs?

No

germain-gg commented 2 years ago

Would require design input as we might want to display the zoom level of the image and change the logic that we use when zooming/unzooming.

AgentOak commented 2 years ago

So what did design say? ...

I assure you design input is not necessary, the current behavior is simply broken:

Clicking on a picture enlarges it to almost-but-not-exactly 100%, leaving text blurry. Clicking on the "+" (zoom in) button enlarges the picture, to 100%.

This seems to be an obviously unintended inconsistency, i.e. bug, not a design decision.

Also confirm for Element 1.10.6