# gpui: Maintain \`img\` aspect ratio when \`max_width\` is set \(\#25632\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c37f616c3b21e401105b3cc39636d08ad6e83eb6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c37f616c3b21e401105b3cc39636d08ad6e83eb6

Requested commit: c37f616c3b21e401105b3cc39636d08ad6e83eb6

Commit: c37f616c3b21e401105b3cc39636d08ad6e83eb6

Tree: d3cb77a952f05d0b2d746d63c7549b1a819fcc7d

Author: Jason Lee

Committer: GitHub

## Message

```
gpui: Maintain `img` aspect ratio when `max_width` is set (#25632)

Release Notes:

- Fixed Markdown preview to display image with max width 100%.

## Before

<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/359628df-8746-456f-a768-b3428923c937"
/>
<img width="750" alt="SCR-20250226-napv"
src="https://github.com/user-attachments/assets/f6154516-470e-41b2-84f5-ef0612c447ad"
/>


## After

<img width="1149" alt="image"
src="https://github.com/user-attachments/assets/2279347d-9c69-4a47-bb62-ccc8e55a98f6"
/>
<img width="520" alt="SCR-20250226-ngyz"
src="https://github.com/user-attachments/assets/03af5f14-1935-472e-822f-4c7f62630780"
/>
```

## Parents

- [73ac19958a6219ea8300304535427ed0dc0e4bfa](https://git.cafe/gitcafe/zed/commit/73ac19958a6219ea8300304535427ed0dc0e4bfa?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c37f616c3b21e401105b3cc39636d08ad6e83eb6?format=markdown)
