开放使用file, 处理, 而不是标记。 http://www.ohchr.org。
This will cause you trouble later should you try to do a read.
I.e., you want
$n = read IMAGE, $data, 4;
to actually get data from the file.
Expanding on the previous code:
use Image::ExifTool;
my $exifTool = new Image::ExifTool;
$filename = $ARGV[0];
open( my $IMAGE, $filename ) || die "Can t Open $filename
";
binmode($IMAGE);
$infob = $exifTool->ImageInfo($IMAGE);
foreach ( keys %$infob ) {
print "$_ => $$infob{$_}
";
}
$n = read $IMAGE, $data, 2;
printf ("read %d bytes: [%s]
", $n, $data);
$ret = close($IMAGE);
print "close returned $ret
";
为此:
GreenMask => 0x0000ff00
BMPVersion => Windows V4
NumColors => 2
PixelsPerMeterX => 3938
RedMask => 0x00ff0000
Planes => 1
FileType => BMP
<snip>
read 2 bytes: [^@^@]
close returned 1
请注意,该读本没有适当发挥作用,因此已经将第一份标书的两根标本退回了建立信任措施。 理由是,公开呼吁没有花cal,而是处理:
use Image::ExifTool;
my $exifTool = new Image::ExifTool;
$filename = $ARGV[0];
open( IMAGE, $filename ) || die "Can t Open $filename
";
binmode(IMAGE);
$infob = $exifTool->ImageInfo($filename);
foreach ( keys %$infob ) {
print "$_ => $$infob{$_}
";
}
$n = read IMAGE, $data, 2;
printf ("read %d bytes: [%s]
", $n, $data);
$ret = close(IMAGE);
print "close returned $ret
";
因此:
Megapixels => 0.994
Directory => .
ImageWidth => 850
ImageSize => 850x1169
BitDepth => 1
<snip>
FilePermissions => rw-r--r--
Compression => None
NumColors => 2
FileName => staves.bmp
BlueMask => 0x000000ff
read 2 bytes: [BM]
close returned 1
“ExifTool”这一读物是正常运转的。
(Hoping the formatting is okay. I m new to this....)