Branch Coverage

blib/lib/Image/ExifTool/CanonVRD.pm
Criterion Covered Total %
branch 211 324 65.1


line true false branch
1456 0 0 if $a =~ /^(0x[0-9a-f]+)?\.?(\d*?)$/
1457 0 0 if $b =~ /^(0x[0-9a-f]+)?\.?(\d*?)$/
1458 0 0 if ($aHex) { }
0 0 elsif ($bHex) { }
1459 0 0 unless defined $bDec
1460 0 0 if $bHex
1463 0 0 unless defined $aDec
1466 0 0 unless defined $bDec
1467 0 0 unless defined $aDec
1478 0 73 unless @vals == 21
1480 0 73 unless $n >= 2 and $n <= 10
1483 144 73 if $val
1495 0 18 unless @vals >= 4 and @vals <= 20 and not @vals & 1
1508 0 38 unless $et
1518 35 3 unless $outfile
1520 3 35 if ($outfile)
1532 19 134 if ($pos + 4 > $dirEnd) { }
1533 19 0 if $pos == $dirEnd
1538 19 115 if $recLen == 0 and $pos + 4 == $dirEnd
1541 0 115 if ($pos + $recLen > $dirEnd)
1547 0 115 if ($verbose > 1 and not $outfile)
1550 0 0 if $recNum
1554 77 38 if $recNum
1569 19 77 unless my $tagInfo = $subTablePtr->{$index}
1572 29 48 if ($tagInfo->{'Size'}) { }
29 19 elsif (defined $tagInfo->{'Size'}) { }
1576 19 10 unless $subStart + 4 <= $recLen
1582 0 58 if $subLen > $maxLen
1583 48 10 if ($subLen)
1589 5 43 if ($outfile) { }
1591 0 5 if $verbose
1593 5 0 if ($newVal)
1596 0 5 if ($sizeDiff)
1617 0 38 if ($outfile and $saveRecLen ne $recLen)
1622 3 35 if ($outfile)
1623 1 2 if $oldChanged == $et->{'CHANGED'}
1626 0 35 $err ? :
1647 0 0 unless ($hdr =~ /^IHL Created Optional Item Data\0\0/)
1654 0 0 if ($size > $next or $pos + 48 + $next > $dirEnd)
1717 105 17 unless $et
1728 4 13 if ($isWriting)
1731 2 2 if ($newVal) { }
0 2 elsif (not $dataPt and $nvHash || $et->{'DEL_GROUP'}{'CanonVRD'}) { }
1735 2 0 if ($outfile) { }
1736 0 2 unless &Write($dirInfo->{'OutFile'}, $newVal)
1746 9 6 if ($dataPt) { }
1752 0 6 unless $raf->Read($buff, 8) == 8 and $buff eq "IIII\4\0\4\0"
1754 0 6 unless $raf->Seek(0, 2)
1756 0 6 unless $raf->Seek(0, 0)
1757 0 6 unless $raf->Read($buff, $dirLen) == $dirLen
1758 0 6 if $err
1765 2 13 if ($et->{'TAGS_FROM_FILE'} and not $et->{'EXCL_TAG_LOOKUP'}{'canondr4'} or $et->{'REQ_TAG_LOOKUP'}{'canondr4'})
1773 0 15 if ($dirLen < 32) { }
1776 0 15 unless &SetByteOrder(substr($$dataPt, $pos, 2))
1785 2 13 if ($outfile) { }
1787 2 0 if $hdr and length $hdr == 32
1794 0 15 if $dirLen < 36 + 28 * $numEntries
1796 0 0 $outfile ? :
0 15 if $err
1798 2 13 if ($outfile) { }
1808 0 1155 if $entry + 28 > $dirEnd
1816 15 1140 if $off + $len >= $dirEnd
1818 15 1125 if (not $format) { }
450 1200 elsif ($format eq 'double' and $len == 8) { }
1824 60 390 if abs $val < "1e-100"
1826 152 988 if ($outfile)
1829 8 144 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
1839 6 2 if (defined $dat and length $dat == $len) { }
1847 288 144 $i >= 0 ? :
1848 430 2 unless $tagInfo
1849 1 1 if ($i >= 0)
1855 2 0 unless defined $val
1858 2 0 if ($et->IsOverwriting($nvHash, $val) and defined $newVal)
1861 2 0 if (defined $rtnVal)
1885 91 2873 if $tagTablePtr->{$flagID}
1888 13 2 unless $isWriting
1889 1 1 unless $raf
1890 1 0 if &Write($outfile, substr($$dataPt, $pos, $dirLen))
1906 6 8 if $dirInfo->{'OutFile'}
1908 2 12 if (not $num and $dirInfo->{'OutFile'}) { }
1911 1 1 if ($newVal) { }
1913 0 1 unless &Write($dirInfo->{'OutFile'}, $newVal)
1918 1 0 if ($et->{'ADD_DIRS'}{'CanonVRD'})
1920 1 0 if (&ProcessCanonVRD($et, {"OutFile", \$newVal}) > 0)
1921 0 1 unless &Write($dirInfo->{'OutFile'}, $newVal)
1929 0 12 unless $num == 28
1930 0 12 unless $buff =~ /^CANON OPTIONAL DATA\0/
1934 0 12 if $result < 0
1935 0 12 unless $result
1948 6 1 unless $et
1951 1 0 unless defined $val
1952 1 0 unless $et->IsOverwriting($nvHash, $val)
1964 0 2 unless $et
1967 1 1 if (defined $val)
1968 0 1 unless $et->IsOverwriting($nvHash, $val)
1975 1 0 if &ProcessCanonVRD($et, $dirInfo, $tagTablePtr) > 0
2000 53 6 if ($raf) { }
2003 2 4 unless ($dataPt)
2004 0 2 unless $outfile
2008 0 2 if $verbose
2014 0 59 unless $raf->Seek(-64 - $offset, 2)
2015 0 59 unless $raf->Read($buff, 64) == 64
2016 0 59 unless $buff =~ /^CANON OPTIONAL DATA\0(.{4})/s
2020 0 59 unless ($dirLen < 2147483648 and $raf->Seek(-$dirLen, 1) and $raf->Read($buff, 28) == 28 and $buff =~ /^CANON OPTIONAL DATA\0/ and $raf->Seek(-28, 1))
2033 14 4 if ($outfile and ref $outfile eq "SCALAR" and not length $$outfile)
2035 3 11 unless $fromFile
2040 53 6 if ($fromFile or $dirInfo->{'DirStart'})
2041 42 11 unless $dataPt
2043 0 53 unless ($raf->Read($$dataPt, $dirLen) == $dirLen)
2044 0 0 if $outfile and $outfile eq $dataPt
2051 18 41 if ($outfile) { }
1 40 elsif ($verbose or $et->{'HTML_DUMP'}) { }
2052 0 18 if $verbose and not $created
2054 4 14 unless (exists $et->{'EDIT_DIRS'}{'CanonVRD'})
2055 0 4 if $verbose
2056 4 0 if $outfile eq $dataPt
2057 0 0 &Write($outfile, $$dataPt) ? :
2061 13 1 unless ($doDel)
2062 0 13 if $et->{'DEL_GROUP'}{'Trailer'} and $et->{'FILE_TYPE'} ne "VRD"
2063 13 0 unless ($doDel)
2065 3 10 if ($et->{'NEW_VALUE'}{$Image::ExifTool::Extra{'CanonVRD'}})
2067 3 0 unless $$dataPt =~ /^.{28}\xff\xff\0\xf7/s
2069 5 8 if ($et->{'NEW_VALUE'}{$Image::ExifTool::Extra{'CanonDR4'}} and not $doDel)
2071 1 4 if $$dataPt =~ /^.{28}\xff\xff\0\xf7/s
2075 5 9 if ($doDel)
2076 1 4 if ($et->{'FILE_TYPE'} eq 'VRD') { }
2078 1 0 if ($newVal) { }
2079 0 1 if $verbose
2080 0 1 if ($outfile eq $dataPt) { }
2083 0 1 unless &Write($outfile, $newVal)
2091 0 4 if $verbose
2092 4 0 if $outfile eq $dataPt
2099 9 0 unless ($val)
2101 4 5 if $val
2103 4 5 if ($val)
2104 0 4 if $verbose
2106 4 0 if $vrdType eq "DR4"
2107 3 1 if ($outfile eq $dataPt) { }
2110 0 1 unless &Write($outfile, $val)
2117 1 0 if $dirInfo->{'RAF'}
2129 46 46 if ($pos + 8 > $end) { }
2130 46 0 if $pos == $end
2136 9 37 if $blockType == 4294902007
2138 0 46 if ($pos + $blockLen > $end)
2142 0 46 if ($verbose > 1 and not $outfile)
2148 0 46 unless ($tagInfo)
2149 0 0 unless ($et->Options("Unknown"))
2163 46 0 if ($tagInfo->{'SubDirectory'}) { }
2175 4 42 if ($outfile) { }
2179 0 4 if ($et->{'NEW_VALUE'}{$tagInfo}) { }
2183 0 0 unless defined $dat
2189 3 1 if (defined $dat)
2190 3 0 if (length $dat or not $et->{'FILE_TYPE'} =~ /^(CRW|VRD)$/) { }
2198 1 2 if (($diff = length($$dataPt) - $dirLen) != 0)
2215 5 41 if ($outfile) { }
7 34 elsif ($vrdType eq 'VRD' and $et->{'TAGS_FROM_FILE'} && !$et->{'EXCL_TAG_LOOKUP'}{'canonvrd'} || $et->{'REQ_TAG_LOOKUP'}{'canonvrd'}) { }
2217 4 1 if ($et->{'ADD_DIRS'}{'CanonVRD'} and not $didDir{'XMP'})
2220 2 2 if ($dat)
2230 5 0 if (length $$dataPt) { }
2231 2 3 unless $outfile eq $dataPt
2233 0 0 if $verbose
2242 0 46 $err ? :