Branch Coverage

blib/lib/Image/ExifTool/Nikon.pm
Criterion Covered Total %
branch 79 318 24.8


line true false branch
13244 0 0 if $pos + $size > $dirEnd
13267 0 0 unless $dat[$i]
13269 0 0 unless $dat[$i] & 1 << $j
13270 0 0 ref $afPoints eq 'HASH' ? :
13271 0 0 if defined $point
13274 0 0 unless @points
13277 0 0 if length $a == length $b
13278 0 0 if length $a == 2
13291 16 0 ref $afPoints eq 'HASH' ? :
13293 0 16 if (@points)
13295 0 0 if (ref $afPoints eq 'HASH') { }
13301 0 0 unless my $bitNum = $bitNum{uc $point}
13316 0 0 if ($inv) { }
13317 0 0 unless $val =~ /^([A-J])(\d+)$/i
13338 0 0 unless $dat[$i]
13340 0 0 unless $dat[$i] & 1 << $j
13342 0 0 if defined $point
13345 0 0 unless @points
13360 0 0 unless defined $n
13362 0 0 if $byte > $size
13376 0 0 if $col == 0
13377 0 0 if $col == $center
13378 0 0 if $col < $center
13379 0 0 if $col > $center
13390 0 0 if $row == 0
13391 0 0 if $row == $center
13392 0 0 if $row < $center
13393 0 0 if $row > $center
13405 0 0 if $val == 0
13406 0 0 if $val == 127
13407 0 0 if $val == -128
13409 0 0 if $val == -127
13421 55 59 if $val =~ /^[-+]?\d+(\.\d+)?$/
13422 0 59 if $val =~ m[n/a]i
13423 3 56 if $val =~ /auto/i
13424 0 56 if $val =~ /user/i
13434 0 0 if $inv
13436 0 0 if ($$conv{"$val.1"})
13439 0 0 unless my $lens = $$conv{"$val.$i"}
13440 0 0 if ($Image::ExifTool::userLens{$lens}) { }
13446 0 0 if @user
13456 0 0 if (@ids)
13460 0 0 if @good
13464 0 0 if @good
13468 0 0 if @good
13483 0 158 if (length $str > $lim and $lim >= 5) { }
13488 102 56 if ($str =~ /[AEIOUY]/)
13491 55 47 if ($str =~ s/\b([AEIOUY])([A-Z]+)/$1\L$2\E/g)
13497 46 56 if ($str =~ s/\b([A-Z])([A-Z]*[AEIOUY][A-Z]*)/$1\L$2\E/g)
13561 1 4 unless $start
13563 1 4 if not defined $len or $len > $maxLen
13564 4 1 if (defined $serial and defined $count)
13573 1 4 if (defined $decryptStart) { }
13582 1 4 if $len <= 0
13600 32 0 if not defined $serial or $serial =~ /^\d+$/
13601 0 0 if $et->{'Model'} =~ /\bD50$/
13614 0 0 $dirInfo ? :
13617 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"
13623 0 0 if $trailerLen > $fileEnd
13624 0 0 if ($dirInfo)
13627 0 0 if ($dirInfo->{'OutFile'})
13628 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) { }
13639 0 0 if $verbose or $et->{'HTML_DUMP'}
13641 0 0 unless ($trailerLen >= 64 and $raf->Seek($fileEnd - $trailerLen, 0) and $raf->Read($buff, 64) == 64 and $buff =~ /NIKON APP\0/)
13650 0 0 if ($len & 2147483648)
13654 0 0 if $id == 0 and $len == 0
13655 0 0 unless ($raf->Read($buff, $len) == $len)
13659 0 0 if ($id == 1) { }
13693 0 0 unless ($fmtStr)
13694 0 0 if $pass
13698 0 0 if ($pos + $size > $end)
13699 0 0 if $pass
13702 0 0 if ($pass) { }
0 0 elsif (exists $needTags{$tag}) { }
13713 0 0 if ($key)
13714 0 0 if $rational
13715 0 0 if $et->{'OPTIONS'}{'SaveBin'}
13736 0 3 if ref $tagInfo eq "ARRAY"
13738 0 0 if $ignoreSubdir and $tagInfo->{'SubDirectory'}
13740 1 2 $fmt =~ s/\[(\d+)\]$// ? :
13741 0 3 unless my $sz = &Image::ExifTool::FormatSize($fmt)
13758 3 0 unless $vars
13759 0 3 if ($vars->{'NIKON_OFFSETS'} and not $vars->{'NIKON_INITIALIZED'})
13764 0 0 unless ref $tagInfo eq "HASH"
13765 0 0 unless my $subdir = $tagInfo->{'SubDirectory'}
13775 3 0 unless ($tagInfo->{'NikonInitialized'})
13781 1 2 if (defined $off) { }
13788 3 0 if (@tagIDs) { }
13791 0 3 if ref $lastInfo eq "ARRAY"
13792 1 2 if $first + $off > $start
13794 3 0 if (defined $subdir->{'KnownEnd'}) { }
13815 0 0 if $offset + 4 > $dataLen or $offset < $start
13822 0 0 if $offset + 4 + $more > $dataLen
13830 0 0 unless my $off = &Get32u($dataPt, $pos)
13833 0 0 if ($tagInfo) { }
0 0 elsif ($unknown > 1) { }
13834 0 0 if ref $tagInfo ne "HASH" or not $tagInfo->{'Unknown'}
13839 0 0 unless (%$tbl)
13855 0 0 unless $Image::ExifTool::Nikon::a->[1] <=> $Image::ExifTool::Nikon::b->[1]
13862 0 0 if $tagInfo and not ref $tagInfo eq 'HASH' && $tagInfo->{'AlwaysDecrypt'}
13865 0 0 if ref $tagInfo eq "HASH" and defined($subdir = $tagInfo->{'SubDirectory'})
13866 0 0 if ($decryptMode) { }
0 0 elsif ($tagInfo and ref $tagInfo ne 'HASH' || !$tagInfo->{'Unknown'}) { }
13868 0 0 if $sorted[$i][2]
13872 0 0 if ($subdir and $subdir->{'KnownEnd'})
13874 0 0 if ($n > $len)
13875 0 0 unless $tagInfo->{'AlwaysDecrypt'}
13882 0 0 if ($decryptMode)
13884 0 0 if $decryptMode == 2 or not $end or $end < $dpos
13897 119 3 unless $et
13900 0 3 unless (defined $serial and defined $count and $serial =~ /^\d+$/ and $count =~ /^\d+$/)
13901 0 0 if (defined $serial or defined $count)
13903 0 0 if (defined $serial and defined $count) { }
13904 0 0 $serial =~ /^\d+$/ ? :
13906 0 0 defined $serial ? :
13916 0 3 $isWriting ? :
13924 0 3 if ($isWriting)
13925 0 0 if ($et->{'NewNikonSerialKey'})
13929 0 0 if ($et->{'NewNikonCountKey'})
13934 3 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
13941 1 2 defined $subdir->{'DirOffset'} ? :
13943 1 2 if $subdir->{'ByteOrder'}
13947 0 0 $recrypt ? :
0 3 $unknown ? :
0 3 $isWriting ? :
13948 0 3 if ($tagTablePtr->{'VARS'}{'NIKON_OFFSETS'}) { }
3 0 elsif ($dMode < 2) { }
13952 1 2 if ($dMode == 0 and $subdir->{'KnownStart'})
13961 3 0 if $subdir->{'KnownEnd'}
13968 0 3 unless $len and $len < $maxLen
13970 3 0 unless $didDecrypt
13972 0 3 if ($verbose > 2)
13990 0 3 if ($isWriting) { }
13994 0 0 if ($recrypt)
13995 0 0 if defined $newSerial
13996 0 0 if defined $newCount
13999 0 0 if ($changed == $et->{'CHANGED'}) { }
14003 0 0 if $offset
14031 24 0 if ($dirStart >= 0 and $dirStart <= $dataLen - 2)
14034 0 24 if $dirStart + 2 + 12 * $numEntries > $dataLen
14037 0 24 unless ($numEntries)
14038 0 0 unless $raf
14040 0 0 unless $raf->Seek($dataPos + $base, 0) and $raf->Read($data, 2) == 2
14043 0 0 unless $raf->Read($buff, $len) == $len
14054 589 8 unless exists $tagHash->{$tagID}
14056 0 8 if $format < 1 or $format > 13
14061 1 7 if ($size > 4)
14062 0 1 if $size > 16777216
14067 0 1 if ($valuePtr < 0 or $valuePtr + $size > $dataLen)
14068 0 0 unless $raf and $raf->Seek($base + $valuePtr + $dataPos, 0) and $raf->Read($buff, $size) == $size
14102 0 2 unless $dirLen > 2
14104 0 2 unless $count and $count * 12 + 2 <= $dirLen
14105 0 2 if ($et->Options("Verbose"))
14113 6 0 if $et->HandleTag($tagTablePtr, $tagID, $value, "Index", $index, "DataPt", $dataPt, "Start", $pos, "Size", 12)
14132 0 0 unless $raf->Read($buff, 53) == 53
14134 0 0 unless $raf->Read($buff, $len) == $len
14149 302 24 unless $et
14159 8 16 if ($dirInfo->{'IsWriting'}) { }