Branch Coverage

blib/lib/Image/ExifTool/Nikon.pm
Criterion Covered Total %
branch 78 300 26.0


line true false branch
11464 0 0 if $pos + $size > $dirEnd
11487 0 0 unless $dat[$i]
11489 0 0 unless $dat[$i] & 1 << $j
11491 0 0 if defined $point
11494 0 0 unless @points
11497 0 0 if length $a == length $b
11498 0 0 if length $a == 2
11513 0 8 if (@points)
11517 0 0 unless my $bitNum = $bitNum{uc $point}
11532 0 0 if ($inv) { }
11533 0 0 unless $val =~ /^([A-J])(\d+)$/i
11554 0 0 unless $dat[$i]
11556 0 0 unless $dat[$i] & 1 << $j
11558 0 0 if defined $point
11561 0 0 unless @points
11576 0 0 unless defined $n
11578 0 0 if $byte > $size
11592 0 0 if $col == 0
11593 0 0 if $col == $center
11594 0 0 if $col < $center
11595 0 0 if $col > $center
11606 0 0 if $row == 0
11607 0 0 if $row == $center
11608 0 0 if $row < $center
11609 0 0 if $row > $center
11621 0 0 if $val == 0
11622 0 0 if $val == 127
11623 0 0 if $val == -128
11625 0 0 if $val == -127
11637 55 59 if $val =~ /^[-+]?\d+(\.\d+)?$/
11638 0 59 if $val =~ m[n/a]i
11639 3 56 if $val =~ /auto/i
11640 0 56 if $val =~ /user/i
11650 0 0 if $inv
11652 0 0 if ($$conv{"$val.1"})
11655 0 0 unless my $lens = $$conv{"$val.$i"}
11656 0 0 if ($Image::ExifTool::userLens{$lens}) { }
11662 0 0 if @user
11672 0 0 if (@ids)
11676 0 0 if @good
11680 0 0 if @good
11684 0 0 if @good
11698 0 153 if (length $str > 60) { }
11703 97 56 if ($str =~ /[AEIOUY]/)
11706 50 47 if ($str =~ s/\b([AEIOUY])([A-Z]+)/$1\L$2\E/g)
11712 46 51 if ($str =~ s/\b([A-Z])([A-Z]*[AEIOUY][A-Z]*)/$1\L$2\E/g)
11776 1 4 unless $start
11778 1 4 if not defined $len or $len > $maxLen
11779 4 1 if (defined $serial and defined $count)
11788 1 4 if (defined $decryptStart) { }
11797 1 4 if $len <= 0
11815 32 0 if not defined $serial or $serial =~ /^\d+$/
11816 0 0 if $et->{'Model'} =~ /\bD50$/
11829 0 0 $dirInfo ? :
11832 0 0 unless $raf->Seek(-20 - $offset, 2) and $raf->Read($buff, 20) == 20 and substr($buff, -16) eq "\0\0\0\0\0\0/NIKON APP"
11838 0 0 if $trailerLen > $fileEnd
11839 0 0 if ($dirInfo)
11842 0 0 if ($dirInfo->{'OutFile'})
11843 0 0 if ($et->{'DEL_GROUP'}{'NikonApp'}) { }
0 0 elsif ($trailerLen > $fileEnd or not $raf->Seek($dirInfo->{'DataPos'}, 0) or $raf->Read(${$$dirInfo{'OutFile'};}, $trailerLen) != $trailerLen) { }
11854 0 0 if $verbose or $et->{'HTML_DUMP'}
11856 0 0 unless ($trailerLen >= 64 and $raf->Seek($fileEnd - $trailerLen, 0) and $raf->Read($buff, 64) == 64 and $buff =~ /NIKON APP\0/)
11865 0 0 if ($len & 2147483648)
11869 0 0 if $id == 0 and $len == 0
11870 0 0 unless ($raf->Read($buff, $len) == $len)
11874 0 0 if ($id == 1) { }
11908 0 0 unless ($fmtStr)
11909 0 0 if $pass
11913 0 0 if ($pos + $size > $end)
11914 0 0 if $pass
11917 0 0 if ($pass) { }
0 0 elsif (exists $needTags{$tag}) { }
11928 0 0 if $rational and $key
11948 0 3 if ref $tagInfo eq "ARRAY"
11950 0 0 if $ignoreSubdir and $tagInfo->{'SubDirectory'}
11952 1 2 $fmt =~ s/\[(\d+)\]$// ? :
11953 0 3 unless my $sz = &Image::ExifTool::FormatSize($fmt)
11970 3 0 unless $vars
11971 0 3 if ($vars->{'NIKON_OFFSETS'} and not $vars->{'NIKON_INITIALIZED'})
11976 0 0 unless ref $tagInfo eq "HASH"
11977 0 0 unless my $subdir = $tagInfo->{'SubDirectory'}
11987 3 0 unless ($tagInfo->{'NikonInitialized'})
11993 1 2 if (defined $off) { }
12000 3 0 if (@tagIDs) { }
12003 0 3 if ref $lastInfo eq "ARRAY"
12004 1 2 if $first + $off > $start
12006 3 0 if (defined $subdir->{'KnownEnd'}) { }
12027 0 0 if $offset + 4 > $dataLen or $offset < $start
12034 0 0 if $offset + 4 + $more > $dataLen
12042 0 0 unless my $off = &Get32u($dataPt, $pos)
12045 0 0 if ($tagInfo) { }
0 0 elsif ($unknown > 1) { }
12046 0 0 if ref $tagInfo ne "HASH" or not $tagInfo->{'Unknown'}
12051 0 0 unless (%$tbl)
12067 0 0 unless $Image::ExifTool::Nikon::a->[1] <=> $Image::ExifTool::Nikon::b->[1]
12075 0 0 if ref $tagInfo eq "HASH" and defined($subdir = $tagInfo->{'SubDirectory'})
12076 0 0 if ($decryptMode) { }
0 0 elsif ($tagInfo and ref $tagInfo ne 'HASH' || !$tagInfo->{'Unknown'}) { }
12078 0 0 if $sorted[$i][2]
12082 0 0 if ($subdir and $subdir->{'KnownEnd'})
12084 0 0 if ($n > $len)
12092 0 0 if ($decryptMode)
12094 0 0 if $decryptMode == 2 or not $end or $end < $dpos
12107 118 3 unless $et
12110 0 3 unless (defined $serial and defined $count and $serial =~ /^\d+$/ and $count =~ /^\d+$/)
12111 0 0 if (defined $serial or defined $count)
12113 0 0 if (defined $serial and defined $count) { }
12114 0 0 $serial =~ /^\d+$/ ? :
12116 0 0 defined $serial ? :
12126 0 3 $isWriting ? :
12134 0 3 if ($isWriting)
12135 0 0 if ($et->{'NewNikonSerialKey'})
12139 0 0 if ($et->{'NewNikonCountKey'})
12144 3 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
12151 1 2 defined $subdir->{'DirOffset'} ? :
12153 1 2 if $subdir->{'ByteOrder'}
12157 0 0 $recrypt ? :
0 3 $unknown ? :
0 3 $isWriting ? :
12158 0 3 if ($tagTablePtr->{'VARS'}{'NIKON_OFFSETS'}) { }
3 0 elsif ($dMode < 2) { }
12162 1 2 if ($dMode == 0 and $subdir->{'KnownStart'})
12171 3 0 if $subdir->{'KnownEnd'}
12178 0 3 unless $len and $len < $maxLen
12180 3 0 unless $didDecrypt
12182 0 3 if ($verbose > 2)
12200 0 3 if ($isWriting) { }
12204 0 0 if ($recrypt)
12205 0 0 if defined $newSerial
12206 0 0 if defined $newCount
12209 0 0 if ($changed == $et->{'CHANGED'}) { }
12213 0 0 if $offset
12241 24 0 if ($dirStart >= 0 and $dirStart <= $dataLen - 2)
12244 0 24 if $dirStart + 2 + 12 * $numEntries > $dataLen
12247 0 24 unless ($numEntries)
12248 0 0 unless $raf
12250 0 0 unless $raf->Seek($dataPos + $base, 0) and $raf->Read($data, 2) == 2
12253 0 0 unless $raf->Read($buff, $len) == $len
12264 589 8 unless exists $tagHash->{$tagID}
12266 0 8 if $format < 1 or $format > 13
12271 1 7 if ($size > 4)
12272 0 1 if $size > 16777216
12277 0 1 if ($valuePtr < 0 or $valuePtr + $size > $dataLen)
12278 0 0 unless $raf and $raf->Seek($base + $valuePtr + $dataPos, 0) and $raf->Read($buff, $size) == $size
12312 0 2 unless $dirLen > 2
12314 0 2 unless $count and $count * 12 + 2 <= $dirLen
12315 0 2 if ($et->Options("Verbose"))
12323 6 0 if $et->HandleTag($tagTablePtr, $tagID, $value, "Index", $index, "DataPt", $dataPt, "Start", $pos, "Size", 12)
12341 299 24 unless $et
12351 8 16 if ($dirInfo->{'IsWriting'}) { }