| โฆ | โฆ | @@ -1538,6 +1538,17 @@ export const ChatMarkdownAssetImage = memo(function ChatMarkdownAssetImage(props | |
| 1546 | + | ? authoredImageSizeStyle(knownSize.width, knownSize.height) | |
| 1547 | + | : undefined; | |
| 1548 | + | const style = | |
| 1549 | + | knownSizeStyle && props.style | |
๐ก Medium components/ChatMarkdown.tsx:1549
The viewed-image { maxHeight: "16rem" } override leaves width/maxWidth sized for authoredImageSizeStyle's 30rem cap, so portrait images reserve a box with excess horizontal space instead of preserving their aspect ratio. Recompute the width constraint from the effective height cap, or use sizing that preserves the ratio under both limits.
๐ Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/web/src/components/ChatMarkdown.tsx around line 1549: |
| 2 | |
| 3 | The viewed-image `{ maxHeight: "16rem" }` override leaves `width`/`maxWidth` sized for `authoredImageSizeStyle`'s `30rem` cap, so portrait images reserve a box with excess horizontal space instead of preserving their aspect ratio. Recompute the width constraint from the effective height cap, or use sizing that preserves the ratio under both limits. |
Fixed in b1c674214b. The cap is passed as maxHeightRem and folded into the width bound (max-width: min(100%, 30rem, 16ยทw/h rem)), so a 720ร1400 image capped at 16rem gets a 132px-wide box rather than a 30rem-wide one. Test added.