7 GetOptions(dumpall => \$dumpall,
11 or die "Usage: $0 filename\n";
13 open my $fh, "<", $file
14 or die "$0: cannot open '$file': $!\n";
19 read($fh, $filehead, 14) == 14
20 or die "Could not read file header: $!\n";
21 my ($h_type, $h_size, $res1, $res2, $h_offset)
22 = unpack("A2VvvV", $filehead);
25 or die "Not a BMP file - no BM signature\n";
37 read($fh, $bmi, 40) == 40
38 or die "Could not read BITMAPINFO\n";
40 my ($i_size, $i_width, $i_height, $i_planes, $i_bits, $i_compress, $i_size_img, $i_xppm, $i_yppm, $clr_used, $clr_imp) =
41 unpack("VVVvvVVVVVV", $bmi);
56 $i_size, $i_width, $i_height, $i_planes, $i_bits, $i_compress, $i_size_img, $i_xppm, $i_yppm, $clr_used, $clr_imp;
59 and die "biSize too small\n";
63 read($fh, $extra_head, $i_size - 40) == $i_size - 40
64 or die "Failed to read rest of header\n";