Skip to content

feat: size HTML images from their width and height attributes - #24

Merged
leonardosalasd merged 1 commit into
mainfrom
feat/html-image-sizing
Sep 10, 2026
Merged

leonardosalasd merged 1 commit into
mainfrom
feat/html-image-sizing

Conversation

@leonardosalasd

Copy link
Copy Markdown
Owner

Documents that embed pictures with <img> usually say how big they want them, and this README is one of them: its GIFs carry a width and its sponsor badges a height. Ignoring both meant every one of them came out at the full text width.

A CSS pixel is a 96th of an inch, so an attribute converts to a real length instead of a guess about how wide the page is. The fit still applies on top, so a number larger than the text block shrinks to it rather than running off the page, and a percentage is ignored because fitting the text block is what the default already does.

Documents that embed pictures with `<img>` usually say how big they want them,
and this README is one of them: its GIFs carry a width and its sponsor badges a
height. Ignoring both meant every one of them came out at the full text width.

A CSS pixel is a 96th of an inch, so an attribute converts to a real length
instead of a guess about how wide the page is. The fit still applies on top, so
a number larger than the text block shrinks to it rather than running off the
page, and a percentage is ignored because fitting the text block is what the
default already does.
@leonardosalasd
leonardosalasd merged commit 39f2196 into main Sep 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant