- 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/SonyIDC.pm
r24107 r34921 12 12 use vars qw($VERSION); 13 13 use Image::ExifTool qw(:DataAccess :Utils); 14 15 $VERSION = '1.02'; 14 use Image::ExifTool::Exif; 15 16 $VERSION = '1.08'; 16 17 17 18 # Sony IDC tags (ref PH) … … 92 93 0x8016 => { Name => 'SaturationAdj', Writable => 'int32s' }, 93 94 0x8017 => { Name => 'ContrastAdj', Writable => 'int32s' }, 94 0x8018 => { Name => 'BrightnessAdj', Writable => 'int32s' }, 95 0x8018 => { 96 Name => 'BrightnessAdj', 97 Writable => 'int32s', 98 PrintConv => 'sprintf("%.2f", $val/300)', #JR 99 PrintConvInv => '$val * 300', 100 }, 95 101 0x8019 => { Name => 'HueAdj', Writable => 'int32s' }, 96 102 0x801a => { Name => 'SharpnessAdj', Writable => 'int32s' }, … … 152 158 0x8031 => { Name => 'PeripheralIllumCentralValue', Writable => 'int32s' }, 153 159 0x8032 => { Name => 'PeripheralIllumPeriphValue', Writable => 'int32s' }, 160 0x8040 => { #JR 161 Name => 'DistortionCompensation', 162 Writable => 'int32s', 163 PrintConv => { 164 -1 => 'n/a', # (fixed by lens) 165 1 => 'On', 166 2 => 'Off', 167 }, 168 }, 154 169 0x9000 => { 155 170 Name => 'ToneCurveBrightnessX', … … 192 207 Count => -1, 193 208 }, 209 0x900d => { #JR 210 Name => 'ChromaticAberrationCorrection', # "Magnification Chromatic Aberration" 211 Writable => 'int32s', 212 PrintConv => { 1 => 'On', 2 => 'Off' }, 213 }, 214 0x900e => { #JR 215 Name => 'InclinationCorrection', 216 Writable => 'int32u', 217 PrintConv => { 0 => 'Off', 1 => 'On' }, 218 }, 219 0x900f => { #JR 220 Name => 'InclinationAngle', 221 Writable => 'int32s', 222 PrintConv => 'sprintf("%.1f deg", $val/1000)', 223 PrintConvInv => 'ToFloat($val) * 1000', 224 }, 225 0x9010 => { #JR 226 Name => 'Cropping', 227 Writable => 'int32u', 228 PrintConv => { 0 => 'Off', 1 => 'On' }, 229 }, 230 0x9011 => { #JR 231 Name => 'CropArea', 232 Writable => 'int32u', 233 Count => 4, 234 }, 235 0x9012 => { #JR 236 Name => 'PreviewImageSize', 237 Writable => 'int32u', 238 Count => 2, 239 }, 240 0x9013 => { #JR (ARQ images) 241 Name => 'PxShiftPeriphEdgeNR', 242 Writable => 'int32s', 243 PrintConv => { 0 => 'Off', 1 => 'On' }, 244 }, 245 0x9014 => { #JR (ARQ images) 246 Name => 'PxShiftPeriphEdgeNRValue', 247 Writable => 'int32s', 248 PrintConv => 'sprintf("%.1f", $val/10)', 249 PrintConvInv => '$val * 10', 250 }, 251 0x9017 => { Name => 'WhitesAdj', Writable => 'int32s' }, #JR 252 0x9018 => { Name => 'BlacksAdj', Writable => 'int32s' }, #JR 253 0x9019 => { Name => 'HighlightsAdj', Writable => 'int32s' }, #JR 254 0x901a => { Name => 'ShadowsAdj', Writable => 'int32s' }, #JR 194 255 0xd000 => { Name => 'CurrentVersion', Writable => 'int32u' }, 195 256 0xd001 => { … … 230 291 GROUPS => { 2 => 'Image' }, 231 292 IDCPreviewImage => { 293 Groups => { 2 => 'Preview' }, 232 294 Require => { 233 295 0 => 'IDCPreviewStart', … … 236 298 # extract all preview images (not just one) 237 299 RawConv => q{ 300 @grps = $self->GetGroup($$val{0}); 238 301 require Image::ExifTool::SonyIDC; 239 302 Image::ExifTool::SonyIDC::ExtractPreviews($self); … … 260 323 sub ExtractPreviews($) 261 324 { 262 my $e xifTool= shift;325 my $et = shift; 263 326 my $i = 1; 264 327 my $xtra = ' (1)'; … … 267 330 for (;;) { 268 331 my $key = "IDCPreviewStart$xtra"; 269 unless (defined $$e xifTool{VALUE}{$key}) {332 unless (defined $$et{VALUE}{$key}) { 270 333 last unless $xtra; 271 334 $xtra = ''; # do the last tag extracted last … … 273 336 } 274 337 # run through IDC preview images in the same order they were extracted 275 my $off = $e xifTool->GetValue($key) or last;276 my $len = $e xifTool->GetValue("IDCPreviewLength$xtra") or last;338 my $off = $et->GetValue($key, 'ValueConv') or last; 339 my $len = $et->GetValue("IDCPreviewLength$xtra", 'ValueConv') or last; 277 340 # get stack version from number in group 1 name 278 my $grp1 = $e xifTool->GetGroup($key, 1);341 my $grp1 = $et->GetGroup($key, 1); 279 342 if ($grp1 =~ /(\d+)$/) { 280 343 my $tag = "IDCPreviewImage$1"; 281 344 unless ($Image::ExifTool::Extra{$tag}) { 282 Image::ExifTool::AddTagToTable(\%Image::ExifTool::Extra, $tag, {345 AddTagToTable(\%Image::ExifTool::Extra, $tag, { 283 346 Name => $tag, 284 Groups => { 0 => 'Composite', 1 => 'Composite', 2 => ' Image'},347 Groups => { 0 => 'Composite', 1 => 'Composite', 2 => 'Preview'}, 285 348 }); 286 349 } 287 my $val = Image::ExifTool::Exif::ExtractImage($e xifTool, $off, $len, $tag);288 $e xifTool->FoundTag($tag, $val);350 my $val = Image::ExifTool::Exif::ExtractImage($et, $off, $len, $tag); 351 $et->FoundTag($tag, $val, $et->GetGroup($key)); 289 352 } else { 290 $preview = Image::ExifTool::Exif::ExtractImage($e xifTool, $off, $len, 'IDCPreviewImage');353 $preview = Image::ExifTool::Exif::ExtractImage($et, $off, $len, 'IDCPreviewImage'); 291 354 } 292 355 # step to next set of tags unless we are done … … 313 376 314 377 This module contains definitions required by Image::ExifTool to read and 315 write Sony Image Data Converter vers on 3.0 metadata in ARW images.378 write Sony Image Data Converter version 3.0 metadata in ARW images. 316 379 317 380 =head1 AUTHOR 318 381 319 Copyright 2003-20 11, Phil Harvey (phil at owl.phy.queensu.ca)382 Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com) 320 383 321 384 This library is free software; you can redistribute it and/or modify it
Note:
See TracChangeset
for help on using the changeset viewer.