Documentation
¶
Overview ¶
Command dimensions reports every image, iframe, video, embed and object that does not declare its size, which is what makes a page shift under the reader as it loads. All five reserve space for content the layout cannot measure until it arrives, and with -fix all five get the style attribute.
dimensions < page.html dimensions -fix -ratio 16:9 < page.html > out.html
It reports rather than rewrites by default, because the right width and height are facts about the image file and this program cannot see the file. With -fix it adds a declared aspect ratio via a style attribute, which reserves space without claiming a pixel size it does not know.
Findings carry the byte range they came from, so a build can point at the source. SourceLocation indexes the bytes fed to the rewriter, not the UTF-8 a handler sees, so the range is correct to slice out of the original file even when the document is in a legacy encoding.