Branch Coverage

blib/lib/Image/ExifTool/MIE.pm
Criterion Covered Total %
branch 241 498 48.3


line true false branch
750 3 0 unless %Image::ExifTool::UserDefined
754 0 0 unless $tableName =~ /^Image::ExifTool::MIE::/
756 0 0 unless my $tagTablePtr = &GetTagTable($tableName)
767 0 0 unless $parent
768 0 0 unless $mieMap{$parent}
771 0 0 unless ref $tagInfo eq "HASH" and $tagInfo->{'SubDirectory'}
773 0 0 unless my $subTablePtr = &GetTagTable($subTableName)
776 0 0 unless $subTablePtr->{'PROCESS_PROC'} and $subTablePtr->{'PROCESS_PROC'} eq \&Image::ExifTool::MIE::ProcessMIE
778 0 0 unless $group
779 0 0 if ($mieMap{$group} and $mieMap{$group} ne $parent)
784 0 0 if $doneTable{$subTableName}
799 10 48 unless $langCode =~ /^[a-z]{2}([-_])[A-Z]{2}$/
801 0 48 if $1 eq "-"
803 0 48 if $tagInfo->{'Writable'} and $tagInfo->{'Writable'} ne "string"
813 0 0 unless (defined $hasZlib)
815 0 0 unless ($hasZlib)
830 31 0 &GetByteOrder() eq 'MM' ? :
831 31 0 $chr ? :
846 332 160 if ($format =~ /^(utf(8|16|32)|string)/) { }
847 308 24 if ($1 eq 'utf8' or $1 eq 'string') { }
854 24 0 if (&GetByteOrder() eq 'MM') { }
855 24 0 $1 eq 'utf16' ? :
857 0 0 $1 eq 'utf16' ? :
860 24 0 if ($] >= 5.006001) { }
868 324 8 unless $format =~ /_list$/
870 0 160 if $format eq "free"
886 0 543 if not $format or $format eq 1
889 1 542 if ($ulist and $$valPtr =~ /(.*)\((.*)\)$/) { }
7 535 elsif (not $format =~ /^(utf|string|undef)/ and $$valPtr =~ /\)$/) { }
892 0 1 unless defined $units
895 1 0 unless $err
899 0 273 if ($format eq "string" and $et->{'OPTIONS'}{'Charset'} ne "UTF8" and $$valPtr =~ /[\x80-\xff]/)
933 9 36 if ($grp eq 'MIE-Main') { }
949 9 36 if (%{$et->{'DEL_GROUP'};})
953 0 9 if $et->{'DEL_GROUP'}{'MIE'} or $et->{'DEL_GROUP'}{$grp} or $et->{'DEL_GROUP'}{$grp1} or $et->{'DEL_GROUP'}{"MIE$n"}
960 0 0 $raf ? :
0 45 if $verbose
966 125 13 if ($raf)
969 1 124 if ($n != 4)
970 0 1 if $n or defined $sync
975 124 14 if ($raf) { }
977 0 124 unless $sync eq "~"
980 93 31 if ($tagLen) { }
981 0 93 unless $raf->Read($tag, $tagLen) == $tagLen
983 0 93 if $tag lt $lastTag
985 1 92 if $tag =~ s/\((.*)\)$//
991 0 124 if ($valLen > 252)
994 0 0 unless $raf->Read($buff, $n) == $n
998 0 0 if ($valLen > 2147483647)
1004 0 0 if ($format == 128 or $delGroup and $tagLen and ($format & 240) != 16)
1005 0 0 unless $raf->Seek($valLen, 1)
1006 0 0 if ($verbose > 1)
1007 0 0 $format == 128 ? :
1010 0 0 if $delGroup
1022 39 95 if $tagLen and $editTags[0] gt $tag
1026 0 95 if length $newTag > 255
1028 36 59 if ($newInfo) { }
1031 0 36 unless ($subTablePtr)
1039 10 26 if ($newTag eq $tag) { }
1041 0 10 if ($isMieGroup xor ($format & 243) == 16)
1046 0 10 if ($format & 4)
1047 0 0 unless &HasZlib($et, "edit")
1048 0 0 unless $raf->Read($oldVal, $valLen) == $valLen
1051 0 0 if $inflate
1052 0 0 unless ($inflate and $stat == Compress::Zlib::Z_STREAM_END())
1061 7 19 unless $addDirs->{$newTag}
1064 23 6 if ($isMieGroup) { }
1066 10 13 if ($newTag eq $tag) { }
0 13 elsif ($optCompress and not $dirInfo->{'IsCompressed'}) { }
1068 10 0 unless $compress
1094 0 13 if $msg
1096 2 11 if (defined $msg) { }
11 0 elsif (not $compress) { }
0 0 elsif (length $newVal <= 4) { }
1104 0 0 if $verbose
1105 0 0 if $newTag eq $tag
1111 0 6 if ($newTag eq $tag)
1112 0 0 unless ($compress)
1114 0 0 unless $raf->Read($oldVal, $valLen) == $valLen
1120 0 0 $dirInfo->{'IsCompressed'} ? :
1125 0 0 if ($compress || $optCompress || $dirInfo->{'IsCompressed'} and eval { do { require Compress::Zlib } })
1137 5 1 if (defined $newVal) { }
1138 0 5 if ($newVal eq "")
1139 0 0 if $newTag eq $tag
1143 1 0 unless defined $oldVal
1158 0 59 unless $isWriting{$writeGroup}
1161 1 58 if ($newTag eq $tag) { }
1164 0 1 if ($isList) { }
1165 0 0 if $nvHash->{'CreateOnly'}
1169 0 1 unless $isOverwriting
1172 0 1 if ($isOverwriting < 0 or $verbose > 1)
1174 0 0 if $format & 4
1176 0 0 unless $raf->Read($oldVal, $valLen) == $valLen
1178 0 0 if ($format & 4)
1184 0 0 if $inflate
1185 0 0 unless ($inflate and $stat == Compress::Zlib::Z_STREAM_END())
1194 0 0 if ($isOverwriting < 0 and defined $val)
1196 0 0 if ($isList) { }
1198 0 0 if ($formatStr =~ /_list$/) { }
1205 0 0 if $et->IsOverwriting($nvHash, $v)
1214 1 0 if ($isOverwriting) { }
1216 1 0 unless (defined $oldVal)
1217 0 1 unless $raf->Seek($valLen, 1)
1219 0 1 if ($verbose > 1)
1220 0 0 if defined $units
1226 0 0 if (defined $oldVal) { }
1228 0 0 if defined $cmpVal
1230 0 0 unless $raf->Read($oldVal, $valLen) == $valLen
1233 0 0 unless &Write($outfile, $toWrite, $oldHdr, $oldVal)
1237 1 0 unless (@newVals)
1246 0 0 unless $nvHash->{'IsCreating'} or $newTag eq $lastTag and $newInfo->{'List'} || $deletedTag eq $lastTag
1250 0 58 unless @newVals
1252 40 18 if ($writable eq 'string') { }
1258 9 31 if ($isUTF8 > 0)
1261 0 9 $isUTF8 > 1 ? :
1263 3 6 if (length $tmp < length $newVal)
1265 0 3 $isUTF8 > 1 ? :
1269 1 39 if @newVals > 1
1275 0 58 unless (defined $newFormat)
1285 1 62 if ($newInfo->{'Units'})
1287 1 0 if ($$valPt =~ /(.*)\((.*)\)$/) { }
1300 16 47 unless ($writable =~ /^(utf|string|undef)/)
1302 0 16 unless defined $val3
1307 0 0 if ($compress || $optCompress and not $dirInfo->{'IsCompressed'} and &HasZlib($et, "write"))
1312 0 0 if ($deflate)
1314 0 0 if defined $val4
1316 0 0 if (defined $val4) { }
1320 0 0 if ($saved > 0) { }
0 0 elsif ($verbose) { }
1321 0 0 if $verbose
1334 60 3 if ($len < 253) { }
3 0 elsif ($len < 65536) { }
0 0 elsif ($len <= 2147483647) { }
1348 0 63 unless &Write($outfile, $hdr, chr $len, $newTag, $extLen, $$valPt)
1351 58 5 unless ($editDirs->{$newTag})
1357 0 63 if defined $oldVal
1363 45 92 unless ($tagLen)
1365 0 45 if $valLen and not $raf->Seek($valLen, 1)
1368 43 2 unless ($toWrite)
1371 9 34 unless ($dirInfo->{'Parent'})
1373 7 2 ref $outfile eq 'SCALAR' ? :
1375 9 0 if ($len and $len <= 2147483647)
1379 0 43 unless &Write($outfile, $term)
1385 23 69 if ($format == 16 or $format == 24)
1388 23 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
1391 23 0 $subTable ? :
1405 0 23 $format & 8 ? :
1408 0 23 if $msg
1409 0 23 if (defined $msg) { }
1418 0 69 unless $raf->Read($oldVal, $valLen) == $valLen
1419 15 54 if ($toWrite)
1420 0 15 unless &Write($outfile, $toWrite)
1423 0 69 unless &Write($outfile, $oldHdr, $oldVal)
1426 0 45 if ($err) { }
0 45 elsif (not $ok || $msg) { }
2 43 elsif (not $msg and $toWrite) { }
1432 0 2 if $verbose
1457 27 112 if ($grp1 eq 'MIE-Main') { }
1459 0 27 if $n > 1
1461 0 112 if $n > 1
1463 0 112 if $cnt->{$grp1} > 1
1468 0 139 if ($verbose)
1477 0 743 unless $raf->Read($buff, 4) == 4
1479 0 743 unless $sync eq "~"
1483 604 139 if ($tagLen) { }
1484 0 604 unless $raf->Read($tag, $tagLen) == $tagLen
1485 0 604 if $tag lt $lastTag
1488 8 596 if $tag =~ s/\((.*)\)$//
1494 3 740 if ($valLen > 252)
1496 0 3 unless $raf->Read($buff, $n) == $n
1499 0 3 if ($valLen > 2147483647)
1506 139 604 unless ($tagLen)
1508 139 0 unless $valLen and not $raf->Seek($valLen, 1)
1516 568 36 if $tagInfo
1518 36 0 if ($tag =~ /\W/)
1519 36 0 if ($tag =~ /^(\w+)-([a-z]{2}_[A-Z]{2})$/) { }
1522 36 0 if $tagInfo
1523 36 0 if $tagInfo
1541 604 0 if ($tagInfo or $formatStr eq "MIE" and $format & 4)
1542 0 604 unless $raf->Read($value, $valLen) == $valLen
1543 0 604 if ($format & 4)
1544 0 0 if ($verbose)
1547 0 0 unless &HasZlib($et, "decode")
1550 0 0 if $inflate
1551 0 0 unless ($inflate and $stat == Compress::Zlib::Z_STREAM_END())
1561 112 492 if ($formatStr eq 'MIE') { }
1564 112 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
1567 112 0 $subTable ? :
1571 0 112 if ($verbose)
1582 0 112 if $valLen
1585 0 112 $format & 8 ? :
1589 0 112 if $msg
1592 492 0 if ($tagInfo) { }
1596 0 492 unless (defined $val)
1601 16 476 if $tag eq "0Type" or $tag eq "2MIME"
1602 0 492 if ($verbose)
1605 0 0 if ($s and not $formatStr =~ /^(utf|string|undef)/)
1608 0 0 $wasCompressed ? :
1617 5 487 if ($tagInfo->{'SubDirectory'}) { }
1629 5 0 unless ($wasCompressed)
1644 117 370 if ($notUTF8 and $formatStr =~ /^(utf|string)/)
1647 8 479 if ($formatStr =~ /_list$/)
1652 8 479 if (defined $units)
1653 0 8 if ref $val
1655 8 0 if defined $units
1658 64 423 if defined $rational and defined $key
1662 0 0 unless $raf->Seek($valLen, 1)
1663 0 0 if $verbose
1668 8 131 if $mime and not $dirInfo->{'Parent'}
1670 0 139 unless $ok or $msg
1671 0 139 if $verbose
1683 656 36 unless defined $et
1691 26 10 if ($dirInfo->{'Trailer'})
1693 0 26 unless $raf->Seek(-10 - $offset, 2)
1696 0 52 unless $raf->Read($buff, 10) == 10
1697 26 26 unless $buff =~ /~\0\0\x06.{4}(\x10|\x18)(\x04)$/s or $buff =~ /(\x10|\x18)(\x08)$/s
1699 26 0 $1 eq "\cP" ? :
1700 26 0 $2 eq "\cD" ? :
1701 0 26 unless my $curPos = $raf->Tell
1702 0 26 if $len < 12 or $len > $curPos
1704 0 26 if ($2 eq "\b")
1705 0 0 if $len < 14
1706 0 0 unless $raf->Seek($curPos - 14, 0) and $raf->Read($buff, 4)
1707 0 0 unless $buff eq "~\0\0\n"
1711 26 0 unless $end
1713 0 26 unless $raf->Seek($pos - 10, 0)
1716 0 26 unless defined $pos and $raf->Seek($pos, 0)
1720 0 26 if ($outfile and $et->{'DEL_GROUP'}{'MIE'}) { }
0 26 elsif ($et->Options('Verbose') or $et->{'HTML_DUMP'}) { }
1735 61 11 if ($num == 8) { }
10 1 elsif ($numDocs) { }
1737 35 26 if ($buff =~ /^~(\x10|\x18)\x04(.)0MIE/s) { }
1738 35 0 $1 eq "\cP" ? :
1741 0 35 if ($len > 252 and not $raf->Seek(1 << 256 - $len, 1))
1746 0 26 unless $numDocs
1747 0 26 if ($buff =~ /^~/) { }
1754 10 0 unless $num
1757 0 1 if $num or not $outfile
1764 26 36 if ($msg)
1765 26 0 if $dirInfo->{'Trailer'}
1766 0 0 if ($outfile) { }
1774 36 0 unless ($numDocs)
1792 9 27 if ($outfile) { }
1794 3 6 unless (%mieCode)
1800 3 6 unless $doneMieMap
1808 0 9 if ($msg) { }
0 18 elsif (defined $msg and $isCreating) { }
1817 0 27 if ($msg)
1826 0 36 $err ? :