NAME

Statocles::Image - A reference to an image

SYNOPSIS

    my $img = Statocles::Image->new(
        src     => '/path/to/image.jpg',
        alt     => 'Alternative text',
    );

DESCRIPTION

This class holds a link to an image, and the attributes required to render its markup. This is used by documents to associate images with the content.

ATTRIBUTES

src

The source URL of the image. Required.

alt

The text to display if the image cannot be fetched or rendered. This is also the text to use for non-visual media.

If missing, the image is presentational only, not content.

width

The width of the image, in pixels.

height

The height of the image, in pixels.

role

The ARIA role for this image. If the "alt" attribute is empty, this attribute defaults to "presentation".

data

A hash of arbitrary data available to theme templates. This is a good place to put extra structured data like image credits, copyright, or location.