- 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/PSP.pm
r24107 r34921 16 16 use Image::ExifTool::Exif; 17 17 18 $VERSION = '1.0 3';18 $VERSION = '1.05'; 19 19 20 20 sub ProcessExtData($$$); … … 66 66 #18 => { 67 67 # Name => 'PreviewImage', 68 # Groups => { 2 => 'Preview' }, 68 69 # RawConv => '$self->ValidateImage(\$val,$tag)', 69 70 #}, … … 163 164 sub ProcessExtData($$$) 164 165 { 165 my ($e xifTool, $dirInfo, $tagTablePtr) = @_;166 my ($et, $dirInfo, $tagTablePtr) = @_; 166 167 my $dataPt = $$dirInfo{DataPt}; 167 168 my $dirLen = $$dirInfo{DirLen}; … … 170 171 while ($pos + 10 < $dirLen) { 171 172 unless (substr($$dataPt, $pos, 4) eq "~FL\0") { 172 $e xifTool->Warn('Lost synchronization while reading sub blocks');173 $et->Warn('Lost synchronization while reading sub blocks'); 173 174 last; 174 175 } … … 177 178 $pos += 10 + $len; 178 179 if ($pos > $dirLen) { 179 $e xifTool->Warn("Truncated sub block ID=$tag len=$len");180 $et->Warn("Truncated sub block ID=$tag len=$len"); 180 181 last; 181 182 } 182 183 next unless $$tagTablePtr{$tag}; 183 my $tagInfo = $e xifTool->GetTagInfo($tagTablePtr, $tag) or next;184 my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag) or next; 184 185 my $start = $pos - $len; 185 186 unless ($$tagInfo{Name} eq 'EXIFInfo') { 186 $e xifTool->HandleTag($tagTablePtr, $tag, undef,187 $et->HandleTag($tagTablePtr, $tag, undef, 187 188 TagInfo => $tagInfo, 188 189 DataPt => $dataPt, … … 213 214 ); 214 215 my $exifTable = GetTagTable($$tagInfo{SubDirectory}{TagTable}); 215 Image::ExifTool::Exif::ProcessExif($e xifTool, \%dirInfo, $exifTable);216 Image::ExifTool::Exif::ProcessExif($et, \%dirInfo, $exifTable); 216 217 SetByteOrder('II'); 217 218 } … … 225 226 sub ProcessPSP($$) 226 227 { 227 my ($e xifTool, $dirInfo) = @_;228 my ($et, $dirInfo) = @_; 228 229 my $raf = $$dirInfo{RAF}; 229 230 my ($buff, $tag, $len, $err); … … 231 232 $buff eq "Paint Shop Pro Image File\x0a\x1a\0\0\0\0\0" and 232 233 $raf->Read($buff, 4) == 4; 233 $e xifTool->SetFileType();234 $et->SetFileType(); 234 235 SetByteOrder('II'); 235 236 my $tagTablePtr = GetTagTable('Image::ExifTool::PSP::Main'); … … 237 238 # figure out block header length for this format PSP file 238 239 my $hlen = $a[0] > 3 ? 10 : 14; 239 $$e xifTool{PSPFileVersion} = $a[0]; # save for use in Condition240 $e xifTool->HandleTag($tagTablePtr, FileVersion => "@a");240 $$et{PSPFileVersion} = $a[0]; # save for use in Condition 241 $et->HandleTag($tagTablePtr, FileVersion => "@a"); 241 242 # loop through blocks in file 242 243 my $pos = 36; … … 244 245 last unless $raf->Read($buff, $hlen) == $hlen; 245 246 unless ($buff =~ /^~BK\0/) { 246 $e xifTool->Warn('Lost synchronization while reading main PSP blocks');247 $et->Warn('Lost synchronization while reading main PSP blocks'); 247 248 last; 248 249 } … … 255 256 } 256 257 $raf->Read($buff, $len) == $len or $err=1, last; 257 $e xifTool->HandleTag($tagTablePtr, $tag, $buff,258 $et->HandleTag($tagTablePtr, $tag, $buff, 258 259 DataPt => \$buff, 259 260 DataPos => $pos - $len, … … 261 262 ); 262 263 } 263 $err and $e xifTool->Warn("Truncated main block ID=$tag len=$len");264 $err and $et->Warn("Truncated main block ID=$tag len=$len"); 264 265 return 1; 265 266 } … … 284 285 =head1 AUTHOR 285 286 286 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)287 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 287 288 288 289 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.