element-hq / element-hq/element-web

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

Open
#20,400 2 comments 0 reactions 0 assignees View on GitHub
A-Media O-Occasional T-Enhancement X-Needs-Design
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

I'm using this image for testing: ![test_image](https://user-images.githubusercontent.com/1313295/148104761-64d3040a-6148-466d-a90b-78e07f1b74fa.png) (from [here](https://en.wikipedia.org/wiki/Lorem_ipsum))

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](https://user-images.githubusercontent.com/1313295/148104911-de1930aa-631c-4cee-9913-74890ec4ec81.png)

#### What happened instead?
The picture got bigger but is still scaled as is evident from the blurry text.

![smallwindow_scaled](https://user-images.githubusercontent.com/1313295/148105065-275ed120-f7e7-4248-aea4-fdb1314c5149.png)

**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

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.