6.1 Image Size Detection

The width and height attributes of <img> tags are essential to a web page even with an only moderate amount of graphics. This is because they allow the page to be rendered incrementally, greatly reducing the delay before the user sees something on his screen. However, keeping these image dimensions up to date is a tedious job. Not anymore...

Draco can automatically add these attributes to for you. For this to work, the src of the image must be a file in the document root of the website, it must be in any of the formats PNG, JPEG or GIF and it must not already have a width or height attribute.

Image size detection is enabled by default, but can be disabled in the configuration file. It is rather efficient because only a few bytes from the header of the image have to be read in order to determine its dimensions. Additionally, a Least Recently Used cache is used to cache the detected image sizes. The size of this cache can be specified in the configuration file too.