The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Statocles::Image - A reference to an image

VERSION

version 0.098

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.

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.