Supplying img sizes automatically
Wednesday, April 4th, 2007What if any tools are available for reading HTML, finding missing width
and height
attributes on img
elements, and filling in the relevant values? So far all I’ve found is this Perl Script from Randal Schwartz circa 1999 and this Perl script based on ImageMagik from Marc Merlins. I haven’t been able to resolve the dependencies for Schwartz’s script yet. Merlins’ runs, but is not XHTML savvy. That may be easy to fix though.
BBEdit almost does this, but it replaces existing height and width attributes too, including ones you’ve deliberately set to a different size. I only want to fill in missing height and width attributes, not change existing ones.
I’d love to find a simple open source GUI tool that could pull this off for an entire site.