- 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/ITC.pm
r24107 r34921 16 16 use Image::ExifTool qw(:DataAccess :Utils); 17 17 18 $VERSION = '1.0 0';18 $VERSION = '1.02'; 19 19 20 20 sub ProcessITC($$); … … 69 69 Name => 'ImageType', 70 70 Format => 'undef[4]', 71 PrintConv => {71 ValueConv => { # (not PrintConv because the unconverted JPEG value is nasty) 72 72 'PNGf' => 'PNG', 73 73 "\0\0\0\x0d" => 'JPEG', … … 84 84 sub ProcessITC($$) 85 85 { 86 my ($e xifTool, $dirInfo) = @_;86 my ($et, $dirInfo) = @_; 87 87 my $raf = $$dirInfo{RAF}; 88 88 my $rtnVal = 0; … … 106 106 last unless $tag eq 'itch'; 107 107 last unless $size >= 0x1c and $size < 0x10000; 108 $e xifTool->SetFileType();108 $et->SetFileType(); 109 109 SetByteOrder('MM'); 110 110 $rtnVal = 1; # this is an ITC file … … 122 122 ); 123 123 my $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Header'); 124 $e xifTool->ProcessDirectory(\%dirInfo, $tagTablePtr);124 $et->ProcessDirectory(\%dirInfo, $tagTablePtr); 125 125 } elsif ($tag eq 'item') { 126 126 # don't want to read the entire item data (includes image) … … 142 142 $raf->Read($buff, $len) == $len or last; 143 143 unless ($len >= 0xb4 and substr($buff, 0xb0, 4) eq 'data') { 144 $e xifTool->Warn('Parsing error. Please submit this ITC file for testing');144 $et->Warn('Parsing error. Please submit this ITC file for testing'); 145 145 last; 146 146 } … … 151 151 ); 152 152 $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Item'); 153 $e xifTool->ProcessDirectory(\%dirInfo, $tagTablePtr);153 $et->ProcessDirectory(\%dirInfo, $tagTablePtr); 154 154 # extract embedded image 155 155 $pos += $len; 156 156 if ($size > 0) { 157 157 $tagTablePtr = GetTagTable('Image::ExifTool::ITC::Main'); 158 my $tagInfo = $e xifTool->GetTagInfo($tagTablePtr, 'data');159 my $image = $e xifTool->ExtractBinary($pos, $size, $$tagInfo{Name});160 $e xifTool->FoundTag($tagInfo, \$image);158 my $tagInfo = $et->GetTagInfo($tagTablePtr, 'data'); 159 my $image = $et->ExtractBinary($pos, $size, $$tagInfo{Name}); 160 $et->FoundTag($tagInfo, \$image); 161 161 # skip the rest of the block if necessary 162 162 $raf->Seek($pos+$size, 0) or last … … 165 165 } 166 166 } else { 167 $e xifTool->VPrint(0, "Unknown $tag block ($size bytes)\n");167 $et->VPrint(0, "Unknown $tag block ($size bytes)\n"); 168 168 $raf->Seek($size-8, 1) or last; 169 169 } 170 170 } 171 $err and $e xifTool->Warn('ITC file format error');171 $err and $et->Warn('ITC file format error'); 172 172 return $rtnVal; 173 173 } … … 192 192 =head1 AUTHOR 193 193 194 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)194 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 195 195 196 196 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.