- Timestamp:
- 2021-02-26T19:39:51+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cpan/Image/ExifTool/PGF.pm
r24107 r34921 16 16 use Image::ExifTool qw(:DataAccess :Utils); 17 17 18 $VERSION = '1.0 1';18 $VERSION = '1.02'; 19 19 20 20 # PGF header information … … 69 69 sub ProcessPGF($$) 70 70 { 71 my ($e xifTool, $dirInfo) = @_;71 my ($et, $dirInfo) = @_; 72 72 my $raf = $$dirInfo{RAF}; 73 73 my $buff; … … 76 76 return 0 unless $raf->Read($buff, 24) == 24 and $buff =~ /^PGF(.)/s; 77 77 my $ver = ord $1; 78 $e xifTool->SetFileType();78 $et->SetFileType(); 79 79 SetByteOrder('II'); 80 80 81 81 # currently support only version 0x36 82 82 unless ($ver == 0x36) { 83 $e xifTool->Error(sprintf('Unsupported PGF version 0x%.2x', $ver));83 $et->Error(sprintf('Unsupported PGF version 0x%.2x', $ver)); 84 84 return 1; 85 85 } 86 86 # extract information from the PGF header 87 87 my $tagTablePtr = GetTagTable('Image::ExifTool::PGF::Main'); 88 $e xifTool->ProcessDirectory({ DataPt => \$buff, DataPos => 0 }, $tagTablePtr);88 $et->ProcessDirectory({ DataPt => \$buff, DataPos => 0 }, $tagTablePtr); 89 89 90 90 my $len = Get32u(\$buff, 4) - 16; # length of post-header data 91 91 92 92 # skip colour table if necessary 93 $len -= $raf->Seek(1024, 1) ? 1024 : $len if $$e xifTool{PGFColorMode} == 2;93 $len -= $raf->Seek(1024, 1) ? 1024 : $len if $$et{PGFColorMode} == 2; 94 94 95 95 # extract information from the embedded metadata image (PNG format) 96 96 if ($len > 0 and $len < 0x1000000 and $raf->Read($buff, $len) == $len) { 97 $e xifTool->ExtractInfo(\$buff, { ReEntry => 1 });97 $et->ExtractInfo(\$buff, { ReEntry => 1 }); 98 98 } 99 99 return 1; … … 120 120 =head1 AUTHOR 121 121 122 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)122 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 123 123 124 124 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.