| 1 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 2 | # File: JVC.pm | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | # Description: JVC EXIF maker notes tags | ||||||||||||||||||||
| 5 | # | ||||||||||||||||||||
| 6 | # Revisions: 12/21/2005 - P. Harvey Created | ||||||||||||||||||||
| 7 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | package Image::ExifTool::JVC; | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 1 | ▶ | use vars qw($VERSION); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 1 | ▶ | use Image::ExifTool qw(:DataAccess :Utils); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 1 | ▶ | use Image::ExifTool::Exif; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | $VERSION = '1.04'; | |||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | sub ProcessJVCText($$$); | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | # JVC EXIF-based maker notes | ||||||||||||||||||||
| 21 | 1 | %Image::ExifTool::JVC::Main = ( | |||||||||||||||||||
| 22 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif, | ||||||||||||||||||||
| 23 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif, | ||||||||||||||||||||
| 24 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, | ||||||||||||||||||||
| 25 | NOTES => 'JVC EXIF maker note tags.', | ||||||||||||||||||||
| 26 | #0x0001 - almost always '2', but '3' for GR-DV700 samples | ||||||||||||||||||||
| 27 | 0x0002 => { #PH | ||||||||||||||||||||
| 28 | Name => 'CPUVersions', | ||||||||||||||||||||
| 29 | # remove trailing nulls/spaces and split at remaining nulls/spaces | ||||||||||||||||||||
| 30 | ValueConv => '$_=$val; s/(\s*\0)+$//; s/(\s*\0)+/, /g; $_', | ||||||||||||||||||||
| 31 | }, | ||||||||||||||||||||
| 32 | 0x0003 => { #PH | ||||||||||||||||||||
| 33 | Name => 'Quality', | ||||||||||||||||||||
| 34 | PrintConv => { | ||||||||||||||||||||
| 35 | 0 => 'Low', | ||||||||||||||||||||
| 36 | 1 => 'Normal', | ||||||||||||||||||||
| 37 | 2 => 'Fine', | ||||||||||||||||||||
| 38 | }, | ||||||||||||||||||||
| 39 | }, | ||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | # JVC text-based maker notes | ||||||||||||||||||||
| 43 | 1 | %Image::ExifTool::JVC::Text = ( | |||||||||||||||||||
| 44 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' }, | ||||||||||||||||||||
| 45 | PROCESS_PROC => \&ProcessJVCText, | ||||||||||||||||||||
| 46 | NOTES => 'JVC/Victor text-based maker note tags.', | ||||||||||||||||||||
| 47 | VER => 'MakerNoteVersion', #PH | ||||||||||||||||||||
| 48 | QTY => { #PH | ||||||||||||||||||||
| 49 | Name => 'Quality', | ||||||||||||||||||||
| 50 | PrintConv => { | ||||||||||||||||||||
| 51 | STND => 'Normal', | ||||||||||||||||||||
| 52 | STD => 'Normal', | ||||||||||||||||||||
| 53 | FINE => 'Fine', | ||||||||||||||||||||
| 54 | }, | ||||||||||||||||||||
| 55 | }, | ||||||||||||||||||||
| 56 | ); | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 59 | # Process JVC text-based maker notes | ||||||||||||||||||||
| 60 | # Inputs: 0) ExifTool object reference | ||||||||||||||||||||
| 61 | # 1) Reference to directory information hash | ||||||||||||||||||||
| 62 | # 2) Pointer to tag table for this directory | ||||||||||||||||||||
| 63 | # Returns: 1 on success, otherwise returns 0 and sets a Warning | ||||||||||||||||||||
| 64 | sub ProcessJVCText($$$) | ||||||||||||||||||||
| 65 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
ProcessJVCText: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||
| 66 | 0 | my ($et, $dirInfo, $tagTablePtr) = @_; | |||||||||||||||||||
| 67 | 0 | my $dataPt = $$dirInfo{DataPt}; | |||||||||||||||||||
| 68 | 0 | ▶ | my $dirStart = $$dirInfo{DirStart} || 0; | ||||||||||||||||||
|
Condition0%0/2
$dirInfo->{'DirStart'} || 0
MC/DC0%0/1
$dirInfo->{'DirStart'} || 0
$dirInfo->{'DirStart'}
Truth table0%0/2
A
A= $dirInfo->{'DirStart'}
| |||||||||||||||||||||
| 69 | 0 | my $dataLen = $$dirInfo{DataLen}; | |||||||||||||||||||
| 70 | 0 | ▶ | my $dirLen = $$dirInfo{DirLen} || $dataLen - $dirStart; | ||||||||||||||||||
|
Condition0%0/3
$dirInfo->{'DirLen'} || $dataLen - $dirStart
MC/DC0%0/2
$dirInfo->{'DirLen'} || $dataLen - $dirStart
$dirInfo->{'DirLen'}
$dataLen - $dirStart
Truth table0%0/3
A || B
A= $dirInfo->{'DirLen'}B= $dataLen - $dirStart
| |||||||||||||||||||||
| 71 | 0 | my $verbose = $et->Options('Verbose'); | |||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 0 | my $data = substr($$dataPt, $dirStart, $dirLen); | |||||||||||||||||||
| 74 | # validate text maker notes | ||||||||||||||||||||
| 75 | 0 | ▶ | unless ($data =~ /^VER:/) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 76 | 0 | $et->Warn('Bad JVC text maker notes'); | |||||||||||||||||||
| 77 | 0 | return 0; | |||||||||||||||||||
| 78 | } | ||||||||||||||||||||
| 79 | 0 | ▶ | while ($data =~ m/([A-Z]+):(.{3,4})/sg) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | 0 | my ($tag, $val) = ($1, $2); | |||||||||||||||||||
| 81 | 0 | my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag); | |||||||||||||||||||
| 82 | 0 | ▶ | $et->VerboseInfo($tag, $tagInfo, | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 83 | Table => $tagTablePtr, | ||||||||||||||||||||
| 84 | Value => $val, | ||||||||||||||||||||
| 85 | ) if $verbose; | ||||||||||||||||||||
| 86 | 0 | ▶ | unless ($tagInfo) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 87 | 0 | ▶ | next unless $$et{OPTIONS}{Unknown}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 88 | 0 | $tagInfo = { | |||||||||||||||||||
| 89 | Name => "JVC_Text_$tag", | ||||||||||||||||||||
| 90 | Unknown => 1, | ||||||||||||||||||||
| 91 | PrintConv => \&Image::ExifTool::LimitLongValues, | ||||||||||||||||||||
| 92 | }; | ||||||||||||||||||||
| 93 | # add tag information to table | ||||||||||||||||||||
| 94 | 0 | AddTagToTable($tagTablePtr, $tag, $tagInfo); | |||||||||||||||||||
| 95 | } | ||||||||||||||||||||
| 96 | 0 | $et->FoundTag($tagInfo, $val); | |||||||||||||||||||
| 97 | } | ||||||||||||||||||||
| 98 | 0 | return 1; | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 1 | 1; # end | |||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | __END__ | ||||||||||||||||||||