<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Tags::HTML::Image - Tags helper class for image presentation.

SYNOPSIS
     use Tags::HTML::Image;

     my $obj = Tags::HTML::Image-&gt;new(%params);
     $obj-&gt;cleanup;
     $obj-&gt;init($image);
     $obj-&gt;prepare;
     $obj-&gt;process;
     $obj-&gt;process_css;

METHODS
  "new"
     my $obj = Tags::HTML::Image-&gt;new(%params);

    Constructor.

    *       "css_class"

            Image CSS class.

            Default value is 'image'.

    *       "css_comment_height"

            Image comment height (in pixels).

            Default value is 50.

    *       "fit_minus"

            Length to minus of image fit.

            Default value is undef.

    *       "img_comment_cb"

            Image comment callback.

            Default value is undef.

    *       "img_select_cb"

            Image select callback.

            Default value is undef.

    *       "img_src_cb"

            Image src callback across data object.

            Default value is undef.

    *       "img_width"

            Image width in pixels.

            Default value is undef.

    *       "tags"

            'Tags::Output' object.

            Default value is undef.

    *       "title"

            Image title.

            Default value is undef.

    Returns instance of object.

  "cleanup"
     $obj-&gt;cleanup;

    Process cleanup after page run.

    Returns undef.

  "init"
     $obj-&gt;init($image);

    Process initialization in page run.

    Take Data::Image object as $image,

    Returns undef.

  "prepare"
     $obj-&gt;prepare;

    Process initialization before page run.

    It is not used in this module.

    Returns undef.

  "process"
     $obj-&gt;process;

    Process Tags structure for output with hello world message.

    Returns undef.

  "process_css"
     $obj-&gt;process_css;

    Process CSS::Struct structure.

    Returns undef.

ERRORS
     new():
             From Class::Utils::set_params():
                     Unknown parameter '%s'.
             From Mo::utils::CSS::check_css_class():
                     Parameter 'css_class' has bad CSS class name.
                             Value: %s
                     Parameter 'css_class' has bad CSS class name (number on begin).
                             Value: %s
             From Tags::HTML::new():
                     Parameter 'css' must be a 'CSS::Struct::Output::*' class.
                     Parameter 'tags' must be a 'Tags::Output::*' class.
             Parameter 'img_comment_cb' must be a code.
             Parameter 'img_select_cb' must be a code.
             Parameter 'img_src_cb' must be a code.

     init():
             Image object is required.
             Image object must be a instance of 'Data::Image'.
             No image URL.

     process():
             From Tags::HTML::process():
                     Parameter 'tags' isn't defined.

     process_css():
             From Tags::HTML::process_css():
                     Parameter 'css' isn't defined.

EXAMPLE1
     use strict;
     use warnings;

     use CSS::Struct::Output::Indent;
     use Data::Image;
     use DateTime;
     use Tags::HTML::Image;
     use Tags::Output::Indent;

     # Object.
     my $css = CSS::Struct::Output::Indent-&gt;new;
     my $tags = Tags::Output::Indent-&gt;new;
     my $obj = Tags::HTML::Image-&gt;new(
             'css' =&gt; $css,
             'tags' =&gt; $tags,
     );

     # Definition of image.
     my $image = Data::Image-&gt;new(
             'author' =&gt; 'Zuzana Zonova',
             'comment' =&gt; 'Michal from Czechia',
             'dt_created' =&gt; DateTime-&gt;new(
                     'day' =&gt; 1,
                     'month' =&gt; 1,
                     'year' =&gt; 2022,
             ),
             'height' =&gt; 2730,
             'size' =&gt; 1040304,
             'url' =&gt; 'https://upload.wikimedia.org/wikipedia/commons/a/a4/Michal_from_Czechia.jpg',
             'width' =&gt; 4096,
     );

     # Init.
     $obj-&gt;init($image);

     # Process HTML and CSS.
     $obj-&gt;process;
     $obj-&gt;process_css;

     # Print out.
     print "HTML:\n";
     print $tags-&gt;flush;
     print "\n\n";
     print "CSS:\n";
     print $css-&gt;flush;

     # Output:
     # HTML:
     # &lt;figure class="image"&gt;
     #   &lt;img alt="Michal from Czechia" src=
     #     "https://upload.wikimedia.org/wikipedia/commons/a/a4/Michal_from_Czechia.jpg"
     #     &gt;
     #   &lt;/img&gt;
     #   &lt;figcaption&gt;
     #     Michal from Czechia
     #   &lt;/figcaption&gt;
     # &lt;/figure&gt;
     # 
     # CSS:
     # .image img {
     #         display: block;
     #         height: 100%;
     #         width: 100%;
     #         object-fit: contain;
     # }
     # .image {
     #         height: calc(100vh);
     # }
     # .image figcaption {
     #         position: absolute;
     #         bottom: 0;
     #         background: rgb(0, 0, 0);
     #         background: rgba(0, 0, 0, 0.5);
     #         color: #f1f1f1;
     #         width: 100%;
     #         transition: .5s ease;
     #         opacity: 0;
     #         font-size: 25px;
     #         padding: 12.5px 5px;
     #         text-align: center;
     # }
     # figure.image:hover figcaption {
     #         opacity: 1;
     # }

EXAMPLE2
     use strict;
     use warnings;
 
     use CSS::Struct::Output::Indent;
     use Data::Image;
     use DateTime;
     use Plack::App::Tags::HTML;
     use Plack::Runner;
     use Tags::Output::Indent;
 
     my $image = Data::Image-&gt;new(
            'author' =&gt; 'Zuzana Zonova',
            'comment' =&gt; 'Michal from Czechia',
            'dt_created' =&gt; DateTime-&gt;new(
                    'day' =&gt; 1,
                    'month' =&gt; 1,
                    'year' =&gt; 2022,
            ),
            'height' =&gt; 2730,
            'size' =&gt; 1040304,
            'url' =&gt; 'https://upload.wikimedia.org/wikipedia/commons/a/a4/Michal_from_Czechia.jpg',
            'width' =&gt; 4096,
     );
 
     my $app = Plack::App::Tags::HTML-&gt;new(
            'component' =&gt; 'Tags::HTML::Image',
            'css' =&gt; CSS::Struct::Output::Indent-&gt;new,
            'data_init' =&gt; [$image],
            'tags' =&gt; Tags::Output::Indent-&gt;new(
                    'xml' =&gt; 1,
                    'preserved' =&gt; ['style'],
            ),
            'title' =&gt; 'Image',
     )-&gt;to_app;
     Plack::Runner-&gt;new-&gt;run($app);

     # Output (GET /):
     # &lt;!DOCTYPE html&gt;
     # &lt;html lang="en"&gt;
     #   &lt;head&gt;
     #     &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
     #     &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
     #     &lt;title&gt;
     #       Image
     #     &lt;/title&gt;
     #     &lt;style type="text/css"&gt;
     # * {
     #         box-sizing: border-box;
     #         margin: 0;
     #         padding: 0;
     # }
     # .image img {
     #         display: block;
     #         height: 100%;
     #         width: 100%;
     #         object-fit: contain;
     # }
     # .image {
     #         height: calc(100vh);
     # }
     # .image figcaption {
     #         position: absolute;
     #         bottom: 0;
     #         background: rgb(0, 0, 0);
     #         background: rgba(0, 0, 0, 0.5);
     #         color: #f1f1f1;
     #         width: 100%;
     #         transition: .5s ease;
     #         opacity: 0;
     #         font-size: 25px;
     #         padding: 12.5px 5px;
     #         text-align: center;
     # }
     # figure.image:hover figcaption {
     #         opacity: 1;
     # }
     # &lt;/style&gt;
     #   &lt;/head&gt;
     #   &lt;body&gt;
     #     &lt;figure class="image"&gt;
     #       &lt;img alt="Michal from Czechia" src=
     #         "https://upload.wikimedia.org/wikipedia/commons/a/a4/Michal_from_Czechia.jpg"
     #         /&gt;
     #       &lt;figcaption&gt;
     #         Michal from Czechia
     #       &lt;/figcaption&gt;
     #     &lt;/figure&gt;
     #   &lt;/body&gt;
     # &lt;/html&gt;

DEPENDENCIES
    Class::Utils, Error::Pure, Mo::utils::CSS, Scalar::Util, Tags::HTML.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Tags-HTML-Image&gt;

AUTHOR
    Michal Josef �麖a�嶤k &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    穢 2022-2024 Michal Josef �麖a�嶤k

    BSD 2-Clause License

VERSION
    0.02

</pre></body></html>