6.7.2 Image Objects

class Image(filename, config, [width, height, alt, depth, longdesc])

Instantiate an Image object.

Image objects contain information about the generated images. This information includes things such as width, height, filename, absolute path, etc. Images objects also have the ability to crop the image that they reference and return information about the baseline of the image that can be used to properly align the image with surrounding text.

filename is the input filename of the image.

config is the “images” section of the document configuration.

width is the width of the image. This is usually extracted from the image file automatically.

height is the height of the image. This is usually extracted from the image file automatically.

alt is a text alternative of the image to be use by renderers such as HTML.

depth is the depth of the image below the baseline of the surrounding text. This is generally calculated automatically when the image is cropped.

longdesc is a long description used to describe the content of the image for renderers such as HTML.

alt

a text alternative of the image to be use by renderers such as HTML.

config

the “images” section of the document’s configuration.

depth

the depth of the image below the baseline of the surrounding text. This is generally calculated automatically when the image is cropped.

filename

the filename of the image.

height

the heigt of the image in pixels.

longdesc

a long description used to describe the content of the image for renderers such as HTML.

path

the absolute path of the image file.

url

the URL of the image. This may be used during rendering.

width

the width of the image in pixels.

crop()

crops the image so that the image edges are flush with the image content. It also sets the depth attribute of the image to the number of pixels that the image extends below the baseline of the surrounding text.