| 1 | package Image::Info::AVIF; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | { use 5.006; } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | our $VERSION = "0.01"; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub die_for_info($) { die bless({ err=>$_[0] }, __PACKAGE__."::__ERROR__") } | ||||||||||||||||||||||||||
|
Subroutine
die_for_info: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=8.5
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | if("$]" >= 5.008) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | *io_string = sub ($) { open(my $fh, "<", \$_[0]); $fh }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | } else { | ||||||||||||||||||||||||||||
| 15 | 0 | require IO::String; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | *io_string = sub ($) { IO::String->new($_[0]) }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 105 | ▶ | sub read_block($$) { | ||||||||||||||||||||||||||
|
Subroutine
read_block: called CC=4 SCAR=14.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 105 | my($fh, $len) = @_; | |||||||||||||||||||||||||||
| 22 | 105 | my $d = ""; | |||||||||||||||||||||||||||
| 23 | 105 | while(1) { | |||||||||||||||||||||||||||
| 24 | 210 | my $dlen = length($d); | |||||||||||||||||||||||||||
| 25 | 210 | ▶ | last if $dlen == $len; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 105 | my $n = read($fh, $d, $len - $dlen, $dlen); | |||||||||||||||||||||||||||
| 27 | 105 | ▶ | if(!defined($n)) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 28 | 0 | die_for_info "read error: $!"; | |||||||||||||||||||||||||||
| 29 | } elsif($n == 0) { | ||||||||||||||||||||||||||||
| 30 | 0 | die_for_info "truncated file"; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 105 | return $d; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 3 | ▶ | sub read_nulterm($) { | ||||||||||||||||||||||||||
|
Subroutine
read_nulterm: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 3 | my($fh) = @_; | |||||||||||||||||||||||||||
| 38 | 3 | my $d = do { local $/ = "\x00"; <$fh> }; | |||||||||||||||||||||||||||
| 39 | 3 | ▶ | defined($d) && $d =~ /\x00\z/ or die_for_info "truncated file"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $d and $d =~ /\x00\z/
MC/DC0%0/2
defined $d and $d =~ /\x00\z/
defined $d
$d =~ /\x00\z/
Truth table33%1/3
A and B
A= defined $dB= $d =~ /\x00\z/
| |||||||||||||||||||||||||||||
| 40 | 3 | chop $d; | |||||||||||||||||||||||||||
| 41 | 3 | return $d; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 12 | ▶ | sub read_heif($$) { | ||||||||||||||||||||||||||
|
Subroutine
read_heif: called CC=10 SCAR=24.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | 12 | my($fh, $box_types_to_keep) = @_; | |||||||||||||||||||||||||||
| 46 | 12 | my %boxes; | |||||||||||||||||||||||||||
| 47 | 12 | ▶ | while(!eof($fh)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 42 | my($len, $type) = unpack("Na4", read_block($fh, 8)); | |||||||||||||||||||||||||||
| 49 | 42 | my $pos = 8; | |||||||||||||||||||||||||||
| 50 | 42 | my $bufp; | |||||||||||||||||||||||||||
| 51 | 42 | ▶ | if($type =~ $box_types_to_keep && !exists($boxes{$type})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$type =~ /$box_types_to_keep/ and not exists $boxes{$type}
MC/DC50%1/2
$type =~ /$box_types_to_keep/ and not exists $boxes{$type}
$type =~ /$box_types_to_keep/
not exists $boxes{$type}
Truth table66%2/3
A and not(B)
A= $type =~ /$box_types_to_keep/B= not exists $boxes{$type}
| |||||||||||||||||||||||||||||
| 52 | 24 | $boxes{$type} = ""; | |||||||||||||||||||||||||||
| 53 | 24 | $bufp = \$boxes{$type}; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | 42 | ▶ | if($len == 1) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | 0 | my($lenhi, $lenlo) = unpack("NN", read_block($fh, 8)); | |||||||||||||||||||||||||||
| 57 | 0 | $pos += 8; | |||||||||||||||||||||||||||
| 58 | 0 | $len = ($lenhi << 32) | $lenlo; | |||||||||||||||||||||||||||
| 59 | 0 | ▶ | $len >> 32 == $lenhi or die_for_info "box size overflow"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | 42 | ▶ | $len >= $pos or die_for_info "bad box length"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 62 | 42 | $len -= $pos; | |||||||||||||||||||||||||||
| 63 | 42 | ▶ | while($len) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 42 | ▶ | my $toread = $len < (1<<16) ? $len : (1<<16); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 65 | 42 | my $d = read_block($fh, $toread); | |||||||||||||||||||||||||||
| 66 | 42 | ▶ | defined($bufp) and $$bufp .= $d; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 42 | $len -= $toread; | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | 12 | return \%boxes; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 2 | my @primaries_type; | |||||||||||||||||||||||||||
| 74 | 2 | $primaries_type[$_] = "RGB" foreach 1, 4, 5, 6, 7, 9, 11, 22; | |||||||||||||||||||||||||||
| 75 | 2 | $primaries_type[10] = "CIEXYZ"; | |||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 3 | ▶ | sub process_file { | ||||||||||||||||||||||||||
|
Subroutine
process_file: called CC=39 SCAR=49.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 78 | 3 | my($info, $source) = @_; | |||||||||||||||||||||||||||
| 79 | 3 | ▶ | if(!eval { local $SIG{__DIE__}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 80 | 3 | my $boxes = read_heif($source, qr/\A(?:ftyp|meta)\z/); | |||||||||||||||||||||||||||
| 81 | 3 | my $ftyp = $boxes->{ftyp}; | |||||||||||||||||||||||||||
| 82 | 3 | ▶ | defined $ftyp or die_for_info "no ftyp box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | 3 | ▶ | length($ftyp) >= 8 && !(length($ftyp) & 3) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
length $ftyp >= 8 and not length $ftyp & 3
MC/DC0%0/2
length $ftyp >= 8 and not length $ftyp & 3
length $ftyp >= 8
not length $ftyp & 3
Truth table33%1/3
A and not(B)
A= length $ftyp >= 8B= not length $ftyp & 3
| |||||||||||||||||||||||||||||
| 84 | or die_for_info "malformed ftyp box"; | ||||||||||||||||||||||||||||
| 85 | 3 | ▶ | substr($ftyp, 0, 4) eq "avif" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | or die_for_info "major brand is not \"avif\""; | ||||||||||||||||||||||||||||
| 87 | 3 | $info->replace_info(0, file_media_type => "image/avif"); | |||||||||||||||||||||||||||
| 88 | 3 | $info->replace_info(0, file_ext => "avif"); | |||||||||||||||||||||||||||
| 89 | 3 | my $mboxes; | |||||||||||||||||||||||||||
| 90 | { | ||||||||||||||||||||||||||||
| 91 | 3 | my $meta = $boxes->{meta}; | |||||||||||||||||||||||||||
| 92 | 3 | ▶ | defined $meta or die_for_info "no meta box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 93 | 3 | my $metafh = io_string($meta); | |||||||||||||||||||||||||||
| 94 | 3 | ▶ | read_block($metafh, 1) eq "\x00" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 95 | or die_for_info "malformed meta box"; | ||||||||||||||||||||||||||||
| 96 | 3 | read_block($metafh, 3); | |||||||||||||||||||||||||||
| 97 | 3 | $mboxes = read_heif($metafh, qr/\A(?:hdlr|iprp)\z/); | |||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | { | ||||||||||||||||||||||||||||
| 100 | 3 | my $hdlr = $mboxes->{hdlr}; | |||||||||||||||||||||||||||
| 101 | 3 | ▶ | defined $hdlr or die_for_info "no hdlr box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | 3 | my $hdlrfh = io_string($hdlr); | |||||||||||||||||||||||||||
| 103 | 3 | ▶ | read_block($hdlrfh, 1) eq "\x00" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | or die_for_info "malformed hdlr box"; | ||||||||||||||||||||||||||||
| 105 | 3 | read_block($hdlrfh, 3); | |||||||||||||||||||||||||||
| 106 | 3 | ▶ | unpack("N", read_block($hdlrfh, 4)) == 0 | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 107 | or die_for_info "non-zero pre-defined value"; | ||||||||||||||||||||||||||||
| 108 | 3 | ▶ | read_block($hdlrfh, 4) eq "pict" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | or die_for_info "handler type is not \"pict\""; | ||||||||||||||||||||||||||||
| 110 | 3 | read_block($hdlrfh, 12); | |||||||||||||||||||||||||||
| 111 | 3 | read_nulterm($hdlrfh); | |||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||
| 113 | 3 | my $pboxes; | |||||||||||||||||||||||||||
| 114 | { | ||||||||||||||||||||||||||||
| 115 | 3 | my $iprp = $mboxes->{iprp}; | |||||||||||||||||||||||||||
| 116 | 3 | ▶ | defined $iprp or die_for_info "no iprp box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | 3 | my $iprpfh = io_string($iprp); | |||||||||||||||||||||||||||
| 118 | 3 | $pboxes = read_heif($iprpfh, qr/\Aipco\z/); | |||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | 3 | my $cboxes; | |||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||
| 122 | 3 | my $ipco = $pboxes->{ipco}; | |||||||||||||||||||||||||||
| 123 | 3 | ▶ | defined $ipco or die_for_info "no ipco box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | 3 | my $ipcofh = io_string($ipco); | |||||||||||||||||||||||||||
| 125 | 3 | $cboxes = read_heif($ipcofh, | |||||||||||||||||||||||||||
| 126 | qr/\A(?:irot|clap|ispe|pixi|colr|pasp)\z/); | ||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | 3 | my $rot = 0; | |||||||||||||||||||||||||||
| 129 | 3 | ▶ | if(defined(my $irot = $cboxes->{irot})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 130 | 0 | ▶ | length($irot) >= 1 or die_for_info "malformed irot box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 131 | 0 | my($angle) = unpack("C", $irot); | |||||||||||||||||||||||||||
| 132 | 0 | ▶ | !($angle & -4) or die_for_info "malformed irot box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 133 | 0 | ▶ | $rot = 1 if $angle & 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | 3 | ▶ | if(defined(my $clap = $cboxes->{clap})) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 136 | 0 | ▶ | length($clap) >= 32 or die_for_info "malformed clap box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 137 | 0 | my($width_num, $width_den, $height_num, $height_den) = | |||||||||||||||||||||||||||
| 138 | unpack("NNNN", $clap); | ||||||||||||||||||||||||||||
| 139 | 0 | ▶ | $width_den != 0 && $height_den != 0 | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$width_den != 0 and $height_den != 0
MC/DC0%0/2
$width_den != 0 and $height_den != 0
$width_den != 0
$height_den != 0
Truth table0%0/3
A and B
A= $width_den != 0B= $height_den != 0
| |||||||||||||||||||||||||||||
| 140 | or die_for_info "malformed clap box"; | ||||||||||||||||||||||||||||
| 141 | 0 | my $width = int($width_num/$width_den); | |||||||||||||||||||||||||||
| 142 | 0 | my $height = int($height_num/$height_den); | |||||||||||||||||||||||||||
| 143 | 0 | ▶ | ($width, $height) = ($height, $width) if $rot; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 144 | 0 | $info->replace_info(0, width => $width); | |||||||||||||||||||||||||||
| 145 | 0 | $info->replace_info(0, height => $height); | |||||||||||||||||||||||||||
| 146 | } elsif(defined(my $ispe = $cboxes->{ispe})) { | ||||||||||||||||||||||||||||
| 147 | 3 | ▶ | length($ispe) >= 12 or die_for_info "malformed ispe box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 148 | 3 | my($ver, undef, $width, $height) = unpack("Ca3NN", $ispe); | |||||||||||||||||||||||||||
| 149 | 3 | ▶ | $ver == 0 or die_for_info "malformed ispe box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 150 | 3 | ▶ | ($width, $height) = ($height, $width) if $rot; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 3 | $info->replace_info(0, width => $width); | |||||||||||||||||||||||||||
| 152 | 3 | $info->replace_info(0, height => $height); | |||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||
| 154 | 3 | ▶ | if(defined(my $pixi = $cboxes->{pixi})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | 3 | ▶ | length($pixi) >= 5 or die_for_info "malformed pixi box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 156 | 3 | my($ver, undef, $planes) = unpack("Ca3C", $pixi); | |||||||||||||||||||||||||||
| 157 | 3 | ▶ | $ver == 0 or die_for_info "malformed pixi box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 158 | 3 | ▶ | length($pixi) >= 5+$planes or die_for_info "malformed pixi box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | 3 | $info->replace_info(0, SamplesPerPixel => $planes); | |||||||||||||||||||||||||||
| 160 | $info->replace_info(0, BitsPerSample => | ||||||||||||||||||||||||||||
| 161 | 3 | [ map { unpack(q(C), substr($pixi, 5+$_, 1)) } 0..$planes-1 ]); | |||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | 3 | ▶ | if(defined(my $colr = $cboxes->{colr})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 164 | 3 | ▶ | length($colr) >= 4 or die_for_info "malformed colr box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 165 | 3 | my $type = substr($colr, 0, 4); | |||||||||||||||||||||||||||
| 166 | 3 | ▶ | if($type eq "nclx") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 167 | 3 | ▶ | length($colr) >= 11 or die_for_info "malformed colr box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 168 | 3 | my($prim) = unpack("n", substr($colr, 4, 2)); | |||||||||||||||||||||||||||
| 169 | 3 | ▶ | if(defined(my $ctype = $primaries_type[$prim])) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 170 | 3 | $info->replace_info(0, color_type => $ctype); | |||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||
| 174 | 3 | ▶ | if(defined(my $pasp = $cboxes->{pasp})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 175 | 0 | ▶ | length($pasp) >= 8 or die_for_info "malformed pasp box"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 176 | 0 | my($hspc, $vspc) = unpack("NN", $pasp); | |||||||||||||||||||||||||||
| 177 | 0 | $info->replace_info(0, resolution => "$vspc/$hspc"); | |||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | 3 | 1; | |||||||||||||||||||||||||||
| 180 | }) { | ||||||||||||||||||||||||||||
| 181 | 0 | my $err = $@; | |||||||||||||||||||||||||||
| 182 | 0 | ▶ | if(ref($err) eq __PACKAGE__."::__ERROR__") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 183 | 0 | $info->replace_info(0, error => $err->{err}); | |||||||||||||||||||||||||||
| 184 | } else { | ||||||||||||||||||||||||||||
| 185 | 0 | die $err; | |||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | 2 | 1; | |||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | =begin register | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | MAGIC: /\A....ftypavif/s | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | Supports the basic standard info key names. | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | =end register | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | =head1 NAME | ||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | Image::Info::AVIF - AV1 Image File Format support for Image::Info | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | use Image::Info qw(image_info); | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | $info = image_info("image.avif"); | ||||||||||||||||||||||||||||
| 209 | if($error = $info->{error}) { | ||||||||||||||||||||||||||||
| 210 | die "Can't parse image info: $error\n"; | ||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | $color = $info->{color_type}; | ||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | This module supplies information about AVIF files within the | ||||||||||||||||||||||||||||
| 217 | L<Image::Info> system. It supports the basic standard info key names. | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | L<Image::Info> | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||
| 225 | Andrew Main (Zefram) <zefram@fysh.org> | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | Copyright (C) 2023 Andrew Main (Zefram) <zefram@fysh.org> | ||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||
| 233 | This module is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 234 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | =head1 ACKNOWLEDGEMENT | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | The development of this module was funded by | ||||||||||||||||||||||||||||
| 239 | Preisvergleich Internet Services AG. | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | =cut | ||||||||||||||||||||||||||||