- 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/AFCP.pm
r24107 r34921 6 6 # Revisions: 12/26/2005 - P. Harvey Created 7 7 # 8 # References: 1) http://w ww.tocarte.com/media/axs_afcp_spec.pdf8 # References: 1) http://web.archive.org/web/20080828211305/http://www.tocarte.com/media/axs_afcp_spec.pdf 9 9 #------------------------------------------------------------------------------ 10 10 … … 15 15 use Image::ExifTool qw(:DataAccess :Utils); 16 16 17 $VERSION = '1.0 4';17 $VERSION = '1.08'; 18 18 19 19 sub ProcessAFCP($$); … … 29 29 ExifTool will read and write (but not create) AFCP IPTC information in JPEG 30 30 and TIFF images. 31 32 See 33 L<http://web.archive.org/web/20080828211305/http://www.tocarte.com/media/axs_afcp_spec.pdf> 34 for the AFCP specification. 31 35 }, 32 36 IPTC => { SubDirectory => { TagTable => 'Image::ExifTool::IPTC::Main' } }, … … 34 38 Nail => { 35 39 Name => 'ThumbnailImage', 40 Groups => { 2 => 'Preview' }, 36 41 # (the specification allows for a variable amount of padding before 37 42 # the image after a 10-byte header, so look for the JPEG SOI marker, … … 46 51 PrVw => { 47 52 Name => 'PreviewImage', 53 Groups => { 2 => 'Preview' }, 48 54 RawConv => q{ 49 55 pos($val) = 10; … … 66 72 sub ProcessAFCP($$) 67 73 { 68 my ($e xifTool, $dirInfo) = @_;74 my ($et, $dirInfo) = @_; 69 75 my $raf = $$dirInfo{RAF}; 70 76 my $curPos = $raf->Tell(); … … 116 122 117 123 $rtnVal = 1; 118 my $verbose = $e xifTool->Options('Verbose');119 my $out = $e xifTool->Options('TextOut');124 my $verbose = $et->Options('Verbose'); 125 my $out = $et->Options('TextOut'); 120 126 my $outfile = $$dirInfo{OutFile}; 121 127 if ($outfile) { 122 128 # allow all AFCP information to be deleted 123 if ($ exifTool->{DEL_GROUP}->{AFCP}) {129 if ($$et{DEL_GROUP}{AFCP}) { 124 130 $verbose and print $out " Deleting AFCP\n"; 125 ++$ exifTool->{CHANGED};131 ++$$et{CHANGED}; 126 132 last; 127 133 } … … 132 138 $vers = substr($buff, 4, 2); # get version number 133 139 } else { 134 $e xifTool->DumpTrailer($dirInfo) if $verbose or $exifTool->{HTML_DUMP};140 $et->DumpTrailer($dirInfo) if $verbose or $$et{HTML_DUMP}; 135 141 } 136 142 # read AFCP directory data … … 138 144 my $dir; 139 145 unless ($raf->Read($dir, 12 * $numEntries) == 12 * $numEntries) { 140 $e xifTool->Error('Error reading AFCP directory', 1);146 $et->Error('Error reading AFCP directory', 1); 141 147 last; 142 148 } … … 144 150 my $dat = $buff . $dir; 145 151 print $out " AFCP Directory:\n"; 146 Image::ExifTool::HexDump(\$dat, undef, 147 Addr => $$dirInfo{DataPos}, 148 Width => 12, 149 Prefix => $exifTool->{INDENT}, 150 Out => $out, 151 ); 152 } 153 $fix and $exifTool->Warn("Adjusted AFCP offsets by $fix", 1); 152 $et->VerboseDump(\$dat, Addr => $$dirInfo{DataPos}, Width => 12); 153 } 154 $fix and $et->Warn("Adjusted AFCP offsets by $fix", 1); 154 155 # 155 156 # process AFCP directory … … 168 169 if ($outfile) { 169 170 # rewrite this information 170 my $tagInfo = $e xifTool->GetTagInfo($tagTablePtr, $tag);171 my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag); 171 172 if ($tagInfo and $$tagInfo{SubDirectory}) { 172 173 my %subdirInfo = ( … … 178 179 ); 179 180 my $subTable = GetTagTable($tagInfo->{SubDirectory}->{TagTable}); 180 my $newDir = $e xifTool->WriteDirectory(\%subdirInfo, $subTable);181 my $newDir = $et->WriteDirectory(\%subdirInfo, $subTable); 181 182 if (defined $newDir) { 182 183 $size = length $newDir; … … 189 190 } else { 190 191 # extract information 191 $e xifTool->HandleTag($tagTablePtr, $tag, $buff,192 $et->HandleTag($tagTablePtr, $tag, $buff, 192 193 DataPt => \$buff, 193 194 Size => $size, … … 197 198 } 198 199 } else { 199 $e xifTool->Warn("Bad AFCP directory");200 $et->Warn("Bad AFCP directory"); 200 201 $rtnVal = -1 if $outfile; 201 202 last; … … 259 260 =head1 AUTHOR 260 261 261 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)262 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 262 263 263 264 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.