| 1 | package Image::Info::GIF; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | $VERSION = '1.02'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | # Copyright 1999-2000, Gisle Aas. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # This library is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | =begin register | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | MAGIC: /^GIF8[79]a/ | ||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | Both GIF87a and GIF89a are supported and the version number is found | ||||||||||||||||||||||||||||||||||||||||||
| 14 | as C<GIF_Version> for the first image. GIF files can contain multiple | ||||||||||||||||||||||||||||||||||||||||||
| 15 | images, and information for all images will be returned if | ||||||||||||||||||||||||||||||||||||||||||
| 16 | image_info() is called in list context. The Netscape-2.0 extension to | ||||||||||||||||||||||||||||||||||||||||||
| 17 | loop animation sequences is represented by the C<GIF_Loop> key for the | ||||||||||||||||||||||||||||||||||||||||||
| 18 | first image. The value is either "forever" or a number indicating | ||||||||||||||||||||||||||||||||||||||||||
| 19 | loop count. | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | =end register | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | sub my_read | ||||||||||||||||||||||||||||||||||||||||||
| 28 | { | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 425 | ▶ | my($source, $len) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
my_read: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 425 | my $buf; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 425 | my $n = read($source, $buf, $len); | |||||||||||||||||||||||||||||||||||||||||
| 32 | 425 | ▶ | die "read failed: $!" unless defined $n; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 425 | ▶ | die "short read ($len/$n) at pos " . tell($source) unless $n == $len; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 425 | $buf; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | sub read_data_blocks | ||||||||||||||||||||||||||||||||||||||||||
| 38 | { | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 7 | ▶ | my $source = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
read_data_blocks: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 7 | my @data; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 7 | ▶ | while (my $len = ord(my_read($source, 1))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 7 | push(@data, my_read($source, $len)); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 7 | join("", @data); | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | sub seek_data_blocks | ||||||||||||||||||||||||||||||||||||||||||
| 48 | { | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 7 | ▶ | my $source = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
seek_data_blocks: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | 7 | ▶ | while (my $len = ord(my_read($source, 1))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 343 | seek($source, $len, 1); | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | sub process_file | ||||||||||||||||||||||||||||||||||||||||||
| 56 | { | ||||||||||||||||||||||||||||||||||||||||||
| 57 | 7 | ▶ | my($info, $fh) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_file: called CC=31 SCAR=40.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 7 | my $header = my_read($fh, 13); | |||||||||||||||||||||||||||||||||||||||||
| 60 | 7 | ▶ | die "Bad GIF signature" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | unless $header =~ s/^GIF(8[79]a)//; | ||||||||||||||||||||||||||||||||||||||||||
| 62 | 7 | my $version = $1; | |||||||||||||||||||||||||||||||||||||||||
| 63 | 7 | $info->push_info(0, "GIF_Version" => $version); | |||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | # process logical screen descriptor | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 7 | my($sw, $sh, $packed, $bg, $aspect) = unpack("vvCCC", $header); | |||||||||||||||||||||||||||||||||||||||||
| 67 | 7 | $info->push_info(0, "ScreenWidth" => $sw); | |||||||||||||||||||||||||||||||||||||||||
| 68 | 7 | $info->push_info(0, "ScreenHeight" => $sh); | |||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 7 | my $color_table_size = 1 << (($packed & 0x07) + 1); | |||||||||||||||||||||||||||||||||||||||||
| 71 | 7 | $info->push_info(0, "ColorTableSize" => $color_table_size); | |||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 7 | ▶ | $info->push_info(0, "SortedColors" => ($packed & 0x08) ? 1 : 0) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | if $version eq "89a"; | ||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | 7 | $info->push_info(0, "ColorResolution", (($packed & 0x70) >> 4) + 1); | |||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 7 | my $global_color_table = $packed & 0x80; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 7 | ▶ | $info->push_info(0, "GlobalColorTableFlag" => $global_color_table ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 7 | ▶ | if ($global_color_table) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 7 | $info->push_info(0, "BackgroundColor", $bg); | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 7 | ▶ | if ($aspect) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | $aspect = ($aspect + 15) / 64; | |||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | $info->push_info(0, "PixelAspectRatio" => $aspect); | |||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | # XXX is this correct???? | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $info->push_info(0, "resolution", "1/$aspect"); | |||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||
| 91 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 7 | $info->push_info(0, "resolution", "1/1"); | |||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | 7 | $info->push_info(0, "file_media_type" => "image/gif"); | |||||||||||||||||||||||||||||||||||||||||
| 96 | 7 | $info->push_info(0, "file_ext" => "gif"); | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | # more?? | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 7 | ▶ | if ($global_color_table) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 7 | my $color_table = my_read($fh, $color_table_size * 3); | |||||||||||||||||||||||||||||||||||||||||
| 101 | #$info->push_info(0, "GlobalColorTable", color_table($color_table)); | ||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 7 | my $img_no = 0; | |||||||||||||||||||||||||||||||||||||||||
| 105 | 7 | my @comments; | |||||||||||||||||||||||||||||||||||||||||
| 106 | my @warnings; | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 7 | while (1) { | |||||||||||||||||||||||||||||||||||||||||
| 109 | 21 | ▶ | last if eof($fh); # EOF | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 19 | my $intro = ord(my_read($fh, 1)); | |||||||||||||||||||||||||||||||||||||||||
| 111 | 19 | ▶ | if ($intro == 0x3B) { # trailer (end of image) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 3 | last; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | elsif ($intro == 0x2C) { # new image | ||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | 7 | ▶ | if (@comments) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 3 | for (@comments) { | |||||||||||||||||||||||||||||||||||||||||
| 119 | 3 | $info->push_info(0, "Comment", $_); | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 3 | @comments = (); | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 7 | $info->push_info($img_no, "color_type" => "Indexed-RGB"); | |||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 7 | my($x_pos, $y_pos, $w, $h, $packed) = | |||||||||||||||||||||||||||||||||||||||||
| 127 | unpack("vvvvC", my_read($fh, 9)); | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 7 | $info->push_info($img_no, "XPosition", $x_pos); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 7 | $info->push_info($img_no, "YPosition", $y_pos); | |||||||||||||||||||||||||||||||||||||||||
| 130 | 7 | $info->push_info($img_no, "width", $w); | |||||||||||||||||||||||||||||||||||||||||
| 131 | 7 | $info->push_info($img_no, "height", $h); | |||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||
| 133 | 7 | ▶ | if ($packed & 0x80) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | # yes, we have a local color table | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | my $ct_size = 1 << (($packed & 0x07) + 1); | |||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $info->push_info($img_no, "LColorTableSize" => $ct_size); | |||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $color_table = my_read($fh, $ct_size * 3); | |||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 7 | ▶ | $info->push_info($img_no, "Interlace" => "GIF") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | if $packed & 0x40; | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | 7 | my $lzw_code_size = ord(my_read($fh, 1)); | |||||||||||||||||||||||||||||||||||||||||
| 144 | #$info->push_info($img_no, "LZW_MininmCodeSize", $lzw_code_size); | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 7 | seek_data_blocks($fh); # skip image data | |||||||||||||||||||||||||||||||||||||||||
| 146 | 7 | $img_no++; | |||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||
| 148 | elsif ($intro == 0x21) { # GIF89a extension | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 7 | ▶ | push(@warnings, "GIF 89a extensions in 87a") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | if $version eq "87a"; | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 7 | my $label = ord(my_read($fh, 1)); | |||||||||||||||||||||||||||||||||||||||||
| 153 | 7 | my $data = read_data_blocks($fh); | |||||||||||||||||||||||||||||||||||||||||
| 154 | 7 | ▶ | if ($label == 0xF9 && length($data) == 4) { # Graphic Control | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition66%2/3
$label == 249 and length $data == 4
MC/DC50%1/2
$label == 249 and length $data == 4
$label == 249
length $data == 4
Truth table66%2/3
A and B
A= $label == 249B= length $data == 4
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 4 | my($packed, $delay, $trans_color) = unpack("CvC", $data); | |||||||||||||||||||||||||||||||||||||||||
| 156 | 4 | my $disposal_method = ($packed >> 2) & 0x07; | |||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | ▶ | $info->push_info($img_no, "DisposalMethod", $disposal_method) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | if $disposal_method; | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 4 | ▶ | $info->push_info($img_no, "UserInput", 1) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | if $packed & 0x02; | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 4 | ▶ | $info->push_info($img_no, "Delay" => $delay/100) if $delay; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 4 | ▶ | $info->push_info($img_no, "TransparencyIndex" => $trans_color) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | if $packed & 0x01; | ||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | elsif ($label == 0xFE) { # Comment | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 3 | $data =~ s/\0+$//; # is often NUL-terminated | |||||||||||||||||||||||||||||||||||||||||
| 167 | 3 | push(@comments, $data); | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | elsif ($label == 0xFF) { # Application | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | my $app = substr($data, 0, 11, ""); | |||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | my $auth = substr($app, -3, 3, ""); | |||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | if ($app eq "NETSCAPE" && $auth eq "2.0" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$app eq "NETSCAPE" and $auth eq "2.0" and $data =~ /^\01/
$app eq "NETSCAPE" and $auth eq "2.0"
MC/DC0%0/3
$app eq "NETSCAPE" and $auth eq "2.0" and $data =~ /^\01/
$app eq "NETSCAPE"
$auth eq "2.0"
$data =~ /^\01/
Truth table0%0/4
A and B and C
A= $app eq "NETSCAPE"B= $auth eq "2.0"C= $data =~ /^\01/
| |||||||||||||||||||||||||||||||||||||||||||
| 173 | && $data =~ /^\01/) { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | my $loop = unpack("xv", $data); | |||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | $loop = "forever" unless $loop; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | $info->push_info(0, "GIF_Loop" => $loop); | |||||||||||||||||||||||||||||||||||||||||
| 177 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $info->push_info(0, "APP-$app-$auth" => $data); | |||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | $info->push_info($img_no, "GIF_Extension-$label" => $data); | |||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||
| 185 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 186 | 2 | push @warnings, "Unknown introduced code $intro, ignoring following chunks"; | |||||||||||||||||||||||||||||||||||||||||
| 187 | 2 | last; | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | 7 | for (@comments) { | |||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | $info->push_info(0, "Comment", $_); | |||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 7 | for (@warnings) { | |||||||||||||||||||||||||||||||||||||||||
| 196 | 2 | $info->push_info(0, "Warn", $_); | |||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | sub color_table | ||||||||||||||||||||||||||||||||||||||||||
| 201 | { | ||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | my @n = unpack("C*", shift); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
color_table: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | die "Color table not a multiple of 3" if @n % 3; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | my @table; | |||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | while (@n) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | my @triple = splice(@n, -3); | |||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | push(@table, sprintf("#%02x%02x%02x", @triple)); | |||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | [reverse @table]; | |||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | __END__ | ||||||||||||||||||||||||||||||||||||||||||