Branch Coverage

blib/lib/Image/ExifTool/WriteExif.pl
Criterion Covered Total %
branch 579 998 58.0


line true false branch
63 0 0 if lc $val eq "now"
64 0 0 if $val =~ /Z$/
65 0 0 if $val =~ /([-+])(\d{1,2}):?(\d{2})/
77 1 6 @a ? :
88 0 1 unless @rows
90 0 1 unless @cols
97 0 2 unless @cols == $ny
101 0 4 unless defined $c
116 124 6229 if (not $format or $format eq 1)
117 124 0 if ($tagInfo->{'Groups'}{'0'} eq 'MakerNotes') { }
135 0 13 if ($val =~ /[\x80-\xff]/) { }
164 0 0 if ($proc ne \&Image::ExifTool::Exif::ProcessExif and $tagInfo->{'Name'} =~ /Text/ or $proc eq \&Image::ExifTool::ProcessBinaryData or $tagInfo->{'PossiblePreview'} and $dirLen > 6 and substr($$dataPt, $dirStart, 3) eq "\377\330\377")
173 23 0 if (defined $loc)
200 23 0 if (defined $rtnValue and length $rtnValue)
202 2 21 if ($newTool->{'PREVIEW_INFO'})
208 9 14 if ($loc)
214 0 9 if ($dirInfo->{'Parent'} eq "IFD0" and $hdr =~ /^(PENTAX |SAMSUNG)\0/)
217 0 0 if ($et->{'Model'} =~ /\b(K(-[57mrx]|(10|20|100|110|200)D|2000)|GX(10|20))\b/)
236 19 4 unless ($subdirInfo{'Relative'})
262 0 0 unless $tagID or $index == 0 or $allowZero
264 0 0 if ($entries{$tagID}) { }
288 0 0 unless my $raf = $dirInfo->{'RAF'}
290 0 0 unless defined $dirStart
293 0 0 unless $raf->Seek($offset + $base, 0) and $raf->Read($buff, 2) == 2
295 0 0 unless $numEntries > 1 and $numEntries < 64
297 0 0 unless $raf->Read($buff, $len) == $len
302 0 0 unless $tagID > $lastID or $dirInfo->{'AllowOutOfOrderTags'}
304 0 0 unless $format > 0 and $format <= 13
306 0 0 unless $count > 0
326 0 0 if $format < 1 or $format > 13
329 0 0 if ($size <= 4)
331 0 0 unless ref $tagTablePtr->{$tagID} eq "HASH" and $tagTablePtr->{$tagID}{'FixCount'}
334 0 0 if $offset >= $ifdEnd
351 278 54 if (defined $et->{'TIFF_END'} and $et->{'TIFF_END'} < $end)
371 5 1 if (!defined($vInfo->{'259'}) || $vInfo->{'259'} eq '1' and $vInfo->{'256'} and $vInfo->{'257'} and $vInfo->{'279'} || $vInfo->{'325'})
375 5 0 $vInfo->{'258'} ? :
381 0 5 if $et->{'DOC_NUM'} or $et->{'FILE_TYPE'} ne "TIFF"
382 0 5 unless (@bitsPerSample == $samplesPerPix)
383 0 0 unless ($et->{'FILE_TYPE'} eq "EPS" and @bitsPerSample == 1)
385 0 0 $samplesPerPix eq '1' ? :
390 0 0 if $_ ne $bitsPerSample[0]
391 0 0 if $_ < 1 or $_ > 32
397 1 4 if ($expectedBytes != $totalBytes and not $et->{'TIFF_TYPE'} =~ /^(K25|KDC|MEF|ORF|SRF)$/)
402 1 0 if ($expectedBytes > $totalBytes) { }
404 0 1 unless $errFlag
410 1 0 if (not defined $minor) { }
435 0 0 unless ref $offsetInfo->{$tagID} eq "ARRAY"
437 0 0 unless $tagInfo->{'IsImageData'}
440 0 0 if ($tagInfo->{'NotRealPair'}) { }
0 0 elsif ($sizeID and $offsetInfo->{$sizeID}) { }
448 0 0 if $tagInfo->{'NotRealPair'}
452 0 0 unless $offset =~ /^\d+$/ and $size and $size =~ /^\d+$/ and $size
453 0 0 unless $raf->Seek($offset, 0)
456 0 0 if ($verbose)
473 0 0 if ($tagTablePtr->{'VARS'} and $tagTablePtr->{'VARS'}{'MINOR_ERRORS'})
474 0 0 if $minor
477 0 0 if $et->Error($errStr, $minor)
489 0 0 unless $et
497 0 0 unless $raf->Seek($base, 0) and $raf->Read($buff, 8) == 8
498 0 0 unless (&SetByteOrder(substr($buff, 0, 2)) and &Get16u(\$buff, 2) == $magic)
500 0 0 if ($dirInfo->{'IsWriting'}) { }
521 0 0 if ($dirInfo->{'IsWriting'})
526 0 0 unless $newDir
530 0 0 if ($et->{'HTML_DUMP'})
531 0 0 &GetByteOrder() eq 'II' ? :
553 8222 331 unless $et
556 34 297 unless ($dataPt)
578 157 8 unless $name and $dirName eq "MakerNotes" and not $name =~ /^MakerNote/
581 199 132 if $dirName eq "IFD0" or $dirName eq "ExifIFD"
584 256 75 if $tagTablePtr->{'GROUPS'}{'0'} eq "EXIF"
587 116 215 if $dirName =~ /^(IFD0|SubIFD)$/ and not defined $dirInfo->{'Multi'}
588 74 257 if $tagTablePtr->{'GROUPS'}{'0'} eq "MakerNotes"
604 118 261 if ($dirStart < 0 or $dirStart > $dataLen - 2) { }
261 0 elsif ($dirLen >= 2) { }
608 0 261 if $dirStart + $len > $dataLen
611 118 261 if ($mustRead)
612 38 80 if ($raf) { }
0 160 elsif ($dirLen and $dirStart + 4 >= $dataLen) { }
616 0 38 unless ($raf->Seek($offset + $base, 0) and $raf->Read($buff, 2) == 2)
621 0 38 unless ($raf->Read($buf2, $len + 4) >= $len)
635 38 0 if $dataLen == $len + 6 and $dirInfo->{'Multi'} || $buff =~ /\0{4}$/
640 0 0 $et->Options('IgnoreMinorErrors') ? :
645 292 87 if ($dirStart + 4 < $dataLen) { }
648 0 292 if ($dirEnd > $dataLen)
651 0 0 unless $n and defined $rtn
660 128 6 if $tagID < $lastID and $tagID || $tagTablePtr->{'0'}
664 0 292 if ($unsorted and not $inMakerNotes || $et->IsRawType)
682 168 1874 ref $tagTablePtr->{$tagID} eq 'ARRAY' || $tagInfo->{'Condition'} ? :
686 2 54 if ($dirName eq "MakerNotes" and $dirInfo->{'Parent'} =~ /^(ExifIFD|IFD0)$/ and not $et->{'TIFF_TYPE'} =~ /^(ARW|SR2)$/ and not $et->{'LeicaTrailerPos'} and &Image::ExifTool::MakerNotes::FixBase($et, $dirInfo))
694 0 2 if $et->{'FORCE_WRITE'}{'FixBase'}
695 0 0 if ($et->{'TIFF_TYPE'} eq "SRW" and $et->{'Make'} eq "SAMSUNG" and $et->{'Model'} eq "EK-GN120")
703 293 86 if ($mandatory) { }
705 6 287 if ($dirName eq "IFD0" and defined $et->{'JFIFYResolution'})
714 87 206 unless ($numEntries)
716 237 84 unless defined $set{$_}
723 74 305 if ($inMakerNotes) { }
730 5 36 unless $set{$_}
732 0 36 if defined $perm and not $perm
734 0 74 if @newTags > 1
758 0 379 if ($inMakerNotes and $et->{'Model'} eq "Canon EOS 40D")
760 0 0 if ($fmt < 1 or $fmt > 13)
773 5125 2002 if (defined $oldID and $oldID == $newID)
777 4746 379 if ($index < $numEntries) { }
783 0 4746 if ($oldFormat < 1 or $oldFormat > 13 and not $oldFormat == 16 && $et->{'Make'} eq 'Apple' && $inMakerNotes)
788 0 0 if ($dirName eq "MakerNotes" and $et->{'Make'} =~ /KODAK/i && $dirInfo->{'Name'} && $dirInfo->{'Name'} eq 'SubIFD3' || $numEntries == 12 && $et->{'Make'} eq 'SONY' && $index >= 8)
799 0 0 if ($oldFormat == 0 and $index and $oldCount == 0)
802 0 0 if $dirInfo->{'FixBase'}
816 585 4161 if (ref $oldInfo ne "HASH" or $oldInfo->{'Condition'})
824 0 2824 if ($oldCount < 2 and $oldInfo and $oldInfo->{'FixCount'})
825 0 0 unless $offList
828 0 0 if (defined $i and $i < $#$offList)
830 0 0 if $oldCount != $readCount
835 2165 2581 if ($oldSize > 4)
838 0 2165 if ($dirInfo->{'FixOffsets'})
839 0 0 unless $valEnd
843 0 0 unless (defined $valuePtr)
844 0 0 unless ($et->{'DropTags'})
845 0 0 $oldInfo ? :
846 0 0 if $et->Error("Bad $name offset for $tagStr", $inMakerNotes)
854 5 2160 if ($dirInfo->{'EntryBased'} or ref $tagTablePtr->{$oldID} eq 'HASH' and $tagTablePtr->{$oldID}{'EntryBased'}) { }
862 0 2165 if $valuePtr < $dirEnd and $valuePtr + $oldSize > $dirStart
864 226 1939 if ($valuePtr < 0 or $valuePtr + $oldSize > $dataLen)
866 218 8 if ($oldInfo) { }
8 0 elsif (defined $oldInfo) { }
871 8 0 if ($tmpInfo)
876 0 226 unless $tagStr
878 0 226 unless ($raf)
879 0 0 if ($tagStr eq 'PreviewImage') { }
0 0 elsif ($leicaTrailer) { }
881 0 0 if ($raf) { }
883 0 0 if ($oldInfo and $oldInfo->{'ChangeBase'})
902 0 0 unless $oldInfo
908 0 226 if ($oldSize > BINARY_DATA_LIMIT() and $origDirInfo->{'ImageData'} and !defined($oldInfo) || $oldInfo && (!$oldInfo->{'SubDirectory'} || $oldInfo->{'ReadFromRAF'})) { }
226 0 elsif ($raf) { }
0 0 elsif (not $invalidPreview) { }
915 0 0 unless (defined $set{$oldID})
916 0 0 $oldSize & 1 ? :
923 0 226 if (defined $pos)
927 0 0 unless ($success and $oldValue =~ /^(\xff\xd8\xff|(.|.{33})\xd8\xff\xdb)/s)
932 0 226 unless ($success)
933 0 0 if $et->Error("Error reading value for $name entry $index", $inMakerNotes)
937 0 0 if $et->Error("Bad $name offset for $tagStr", $inMakerNotes)
940 0 226 if ($invalidPreview) { }
942 0 0 if ($et->{'FILE_TYPE'} eq 'JPEG') { }
962 2 2163 if ($suspect)
963 2 0 $oldInfo ? :
965 2 0 if ($inMakerNotes) { }
968 0 0 if $et->Error($str, 1)
973 4520 226 unless $readFromFile
975 162 4584 if (defined $oldInfo and not $oldInfo)
981 0 0 if ($mayDelete{$oldID} and $oldInfo and !@newTags || $newTags[0] != $oldID)
983 0 0 if (not $nvHash and $wrongDir)
986 0 0 if $nvHash
988 0 0 if ($nvHash)
996 0 4746 if ($oldFormat == 13 || $oldFormat == 18 and not $oldInfo && $oldInfo->{'SubIFD'})
1003 4746 0 if ($oldInfo)
1005 0 4746 if ($oldInfo->{'IsOffset'} || $oldInfo->{'SubIFD'} and not $Image::ExifTool::Exif::intFormat{$oldFormName})
1011 4 0 if ($oldInfo->{'Drop'} and $et->{'DropTags'} and $oldInfo->{'Drop'} == 1 || $oldInfo->{'Drop'} < $oldSize)
1016 289 4453 if ($oldInfo->{'Format'})
1019 0 289 unless ($readFormat)
1024 0 289 if ($oldInfo->{'FixedSize'})
1025 0 0 if $oldInfo->{'FixedSize'}
1032 0 4742 if ($oldID <= $lastTagID and not $inMakerNotes || $et->IsRawType)
1033 0 0 $oldInfo ? :
1034 0 0 if ($oldID == $lastTagID) { }
1037 0 0 if defined $set{$oldID}
1053 2222 4901 if (not defined $oldID) { }
3256 1645 elsif (not defined $newID) { }
1054 379 1843 unless defined $newID
1058 35 3221 if (defined $set{$oldID}) { }
1067 0 1645 if ($unsorted and $isNew)
1068 0 0 if ($isNew > 0 and $hasOldID{$newID})
1073 0 0 if ($isNew < 0 and $hasNewID{$oldID})
1090 2285 4459 $isNew >= 0 ? :
1093 2285 4459 if ($isNew >= 0)
1097 110 70 unless ($curInfo or $addDirs->{$newID})
1102 24 86 if (defined $curInfo and not $curInfo)
1107 535 24 unless $tagInfo->{'TagID'} == $newID
1109 0 24 unless defined $val
1112 23 1 if ($fmt)
1114 0 23 unless defined $val
1117 24 0 if ($curInfo)
1118 21 3 if $curInfo eq $tagInfo
1123 3 21 unless $curInfo
1126 83 27 if ($curInfo and $et->{'NEW_VALUE'}{$curInfo}) { }
1129 26 1 if $isNew > 0
1134 2188 71 if ($curInfo) { }
1 70 elsif (not $addDirs->{$newID}) { }
1135 6 2182 if ($curInfo->{'WriteCondition'})
1138 0 6 unless (eval $curInfo->{'WriteCondition'})
1139 0 0 if $@
1144 2188 0 if $isNew >= 0
1145 1099 1089 unless ($nvHash or defined $mandatory->{$newID})
1146 435 664 unless $wrongDir
1150 28 636 unless $et->IsOverwriting($nvHash)
1154 2 634 if (not defined $nvHash->{'Value'} and $nvHash->{'WantGroup'} and lc $nvHash->{'WantGroup'} eq lc $wrongDir) { }
1164 463 3 if $isNew > 0
1168 1723 73 if ($set{$newID}) { }
40 33 elsif ($isNew > 0) { }
4 29 elsif ($newInfo->{'Format'} and $newInfo->{'Writable'} and $newInfo->{'Writable'} ne '1') { }
0 31 elsif ($addDirs->{$newID} and $newInfo ne $addDirs->{$newID}) { }
1176 1473 250 if ($isNew > 0) { }
241 9 elsif ($nvHash or $xDelete{$newID}) { }
1178 601 872 if ($nvHash) { }
1179 83 518 unless $nvHash->{'IsCreating'}
1180 1 517 if ($newInfo->{'IsOverwriting'}) { }
1187 631 241 if $xDelete{$newID}
1192 72 687 if ($newInfo->{'Format'}) { }
1198 0 687 unless ($newFormName)
1205 3 238 unless ($nvHash)
1209 241 0 if (length $oldValue >= $oldSize) { }
1217 2 239 unless $writable and $writable ne 1
1220 8 233 if ($writeForm ne $newFormName)
1225 2 6 if ($inMakerNotes) { }
2 4 elsif ($writable ne $newFormName) { }
1233 26 9 if ($inMakerNotes and $readFormName ne "string" and $readFormName ne "undef")
1237 1 240 if ($newInfo->{'IsOverwriting'}) { }
1244 994 15 if ($isOverwriting) { }
1245 751 243 unless defined $newVal
1248 22 972 if (not defined $newVal or $xDelete{$newID} and not defined $nvHash->{'Shift'})
1249 0 20 if (not defined $newVal and $newInfo->{'RawConvInv'} and defined $nvHash->{'Value'})
1253 22 0 unless ($isNew)
1259 19 953 if ($newCount and $newCount < 0)
1266 0 972 unless (defined $newValue)
1270 972 0 if (length $newValue) { }
1273 0 751 if ($et->{'FILE_TYPE'} eq "JPEG" and length $newValue > 65436 and $newInfo->{'Name'} ne "PreviewImage")
1276 0 0 $newInfo->{'MakerNotes'} ? :
1280 1 971 if ($strEnc and $newFormName eq "string")
1287 972 0 if ($isNew >= 0)
1290 227 745 if (defined $allMandatory)
1292 80 147 if ($nvHash) { }
1299 13 959 if ($verbose > 1)
1300 0 13 unless $isNew
1301 0 13 if ($newInfo->{'OffsetPair'} and $newVal eq '4277010157') { }
1304 8 5 $nvHash ? :
1310 0 15 if $isNew > 0
1314 75 912 if ($ifdFormName)
1325 0 40 unless $newInfo = $addDirs->{$newID}
1328 0 40 if $newInfo->{'MakerNotes'} or $newInfo->{'Name'} eq "SubIFD"
1330 13 27 if ($newInfo->{'SubDirectory'}{'TagTable'}) { }
1340 36 4 if $newInfo->{'SubIFD'}
1343 2 38 unless defined $newValue and length $newValue
1345 34 4 if ($newInfo->{'SubIFD'}) { }
1363 0 4 unless ($newFormName and $Image::ExifTool::Exif::formatNumber{$newFormName})
1379 4477 1040 if ($isNew < 0)
1387 0 4477 if ($oldImageData)
1393 5517 0 if ($newInfo)
1397 8 5509 if ($newInfo->{'DataTag'} and $isNew >= 0)
1400 4 4 unless (defined $offsetData{$dataTag} or $dataTag eq "LeicaTrailer")
1406 4 0 if (defined $offsetData{$dataTag}) { }
1408 2 2 if ($dataTag eq "PreviewImage")
1410 2 0 if $len <= 4
1415 0 4 if ($err)
1416 0 0 if $newInfo->{'IsOffset'}
1425 43 5474 if ($newInfo->{'MakerNotes'}) { }
442 5032 elsif ($newInfo->{'SubDirectory'} and $isNew <= 0 and not $isOverwriting and !defined($newInfo->{'Writable'}) || $newInfo->{'Writable'} and not $newInfo->{'ReadFromRAF'}) { }
158 4874 elsif ($newInfo->{'OffsetPair'}) { }
272 4602 elsif ($newInfo->{'DataMember'}) { }
1427 1 0 if ($et->{'DEL_GROUP'}{'MakerNotes'} and $et->{'DEL_GROUP'}{'MakerNotes'} != 2 || $isNew <= 0)
1430 0 1 if ($et->IsRawType) { }
1433 1 0 if ($isNew <= 0)
1435 0 1 if $verbose
1441 7 35 if ($isNew >= 0 and defined $set{$newID}) { }
1445 6 1 if ($nvHash and $nvHash->{'MAKER_NOTE_FIXUP'})
1468 35 0 if ($newInfo->{'SubDirectory'})
1470 4 31 if $sub->{'FixBase'}
1473 5 30 if defined $sub->{'Base'}
1475 34 1 if $sub->{'ByteOrder'}
1478 35 0 if ($oldInfo and $oldInfo->{'SubDirectory'}) { }
1480 35 0 if $subTable
1486 35 0 if $subTable
1487 0 35 unless $subTable
1488 0 35 if ($writeProc and $writeProc eq \&Image::ExifTool::MakerNotes::WriteUnknownOrPreview and $oldValue =~ /^\xff\xd8\xff/) { }
33 2 elsif (not $notIFD) { }
1497 33 2 if (defined $loc) { }
1 1 elsif ($subTable->{'PROCESS_PROC'} and $subTable->{'PROCESS_PROC'} eq \&Image::ExifTool::ProcessBinaryData) { }
1 0 elsif ($notIFD) { }
1503 1 32 if ($changed == $et->{'CHANGED'} and $subdirInfo{'Fixup'}->IsEmpty)
1511 1 0 if (defined $sub->{'Start'}) { }
1523 1 0 if ($writeProc)
1529 0 0 if ($et->{'FILE_TYPE'} eq 'JPEG') { }
1535 34 1 if (defined $subdir)
1536 0 34 unless length $subdir
1543 5 29 if ($subdirInfo{'Relative'}) { }
29 0 elsif (not defined $subdirInfo{'Relative'}) { }
1550 1 4 if ($previewInfo)
1553 1 1 unless /_PreviewImage$/
1570 1 28 if ($subdirInfo{'AutoFix'}) { }
0 28 elsif ($subdirInfo{'FixBase'} and $baseShift < 0 and !$subdirInfo{'MinOffset'} || $subdirInfo{'MinOffset'} + $baseShift < 0) { }
1577 0 0 if (not defined $fixBase) { }
0 0 elsif ($fixBase eq '') { }
1578 0 0 $et->Options('IgnoreMinorErrors') ? :
1590 4 25 if ($previewInfo and not $previewInfo->{'NoBaseShift'})
1607 106 336 if ($newInfo->{'SubIFD'}) { }
336 0 elsif (!defined($subdir->{'Start'}) || $subdir->{'Start'} =~ /\$valuePtr/ and $subdir->{'TagTable'}) { }
1612 15 91 if ($subdir->{'TagTable'})
1618 8 98 if $subTable->{'GROUPS'}{'0'} eq "MakerNotes"
1621 0 106 unless ($readCount)
1622 0 0 if $et->Error("$name entry $index has zero count", 2)
1635 109 0 if (defined $subdir->{'Start'})
1638 0 109 unless (&Image::ExifTool::IsInt($newStart))
1646 0 109 if ($subdir->{'Base'})
1652 3 106 if $i
1661 67 42 $imageDataFlag eq 'Main' ? :
1670 55 54 if $newInfo->{'SubIFD'} == 2
1671 0 109 if ($subdir->{'RelativeBase'})
1677 15 94 if ($subdirStart < 0 or $subdirStart + 2 > $dataLen)
1678 15 0 if ($raf) { }
1685 0 0 if ($subTable->{'VARS'} and $subTable->{'VARS'}{'MINOR_ERRORS'}) { }
0 0 elsif ($et->Error(@err)) { }
1694 0 109 unless (defined $subdirData)
1696 0 0 unless $et->{'VALUE'}{'Error'}
1700 0 0 if ($hdrLen and $hdrLen > 0 and $subdirStart <= $dataLen)
1704 6 103 unless (length $subdirData)
1705 6 0 unless $inMakerNotes
1713 4 99 if (ref $subdirInfo{'ImageData'})
1721 5 98 if ($readCount > 1) { }
1739 6 100 unless length $newValue
1742 0 100 if ($writeCount < $readCount and $writeCount == 1)
1760 4 332 if ($subdir->{'Start'})
1767 1 335 if ($subdir->{'Base'})
1786 0 336 unless ($oldSize)
1797 22 314 if $subdir->{'ByteOrder'}
1800 274 62 if (defined $newValue) { }
1802 3 271 if ($hdrLen)
1810 1 335 unless (length $$newValuePt)
1812 1 0 if $oldSize or not $inMakerNotes
1814 5 330 if ($subFixup->{'Pointers'} and $subdirInfo{'Base'} == $base) { }
1828 10 148 if ($dataTag eq 'CanonVRD') { }
7 141 elsif ($dataTag eq 'OriginalDecisionData') { }
1831 1 9 if ($et->{'NEW_VALUE'}{$Image::ExifTool::Extra{'CanonVRD'}}) { }
0 9 elsif ($et->{'DEL_GROUP'}{'CanonVRD'} or $et->{'DEL_GROUP'}{'Trailer'}) { }
1833 1 0 $et->GetNewValue('CanonVRD') ? :
1841 1 9 if ($hasVRD) { }
1855 1 6 if ($oddInfo and $et->{'NEW_VALUE'}{$oddInfo}) { }
1 5 elsif ($$newValuePt ne "\000\000\000\000") { }
1857 0 1 if ($verbose > 1)
1858 0 0 if $$newValuePt ne "\0\0\0\0"
1859 0 0 if $odd
1863 1 0 if (length $$newValuePt == 4) { }
1867 0 1 unless $et->{'FILE_TYPE'} eq "JPEG"
1869 1 0 if ref $odd
1874 2 5 if ($odd) { }
1877 1 1 if $et->{'FILE_TYPE'} eq "JPEG"
1889 137 4 if ($isNew <= 0)
1892 0 137 if $newInfo->{'ByteOrder'}
1895 68 69 unless $newInfo->{'IsOffset'}
1898 0 0 if ($Image::ExifTool::Exif::formatSize[$newFormat] != 4 and $newInfo->{'IsOffset'})
1899 0 0 if $isNew > 0
1900 0 0 if $newCount != $readCount
1905 0 0 unless (defined $newValue)
1911 70 71 unless $offsetInfo
1916 0 141 unless $newCount
1927 0 272 if ($newInfo->{'Format'} and $newInfo->{'Format'} ne $formatStr)
1931 0 0 if $format
1935 272 0 if ($conv) { }
1937 0 272 if (ref $conv eq 'CODE') { }
1957 5509 0 unless $oldInfo and $oldInfo->{'FixedSize'}
1958 153 5356 if ($Image::ExifTool::Exif::saveForValidate{$newID} and $tagTablePtr eq \%Image::ExifTool::Exif::Main)
1962 2511 2998 if ($newSize > 4) { }
1970 5 2506 if ($dirInfo->{'EntryBased'} or $newInfo and $newInfo->{'EntryBased'}) { }
1977 2511 0 if $newInfo
1978 2 2509 if ($dataTag)
1979 1 1 if ($dataTag eq 'PreviewImage' and $et->{'FILE_TYPE'} eq 'JPEG' || $et->{'GENERATE_PREVIEW_INFO'}) { }
0 1 elsif ($dataTag eq 'LeicaTrailer' and $et->{'LeicaTrailer'}) { }
1984 1 0 unless $et->{'PREVIEW_INFO'}
1987 0 1 if $newInfo->{'ChangeBase'}
1988 0 1 if ($newInfo->{'IsOffset'} and $newInfo->{'IsOffset'} eq 2)
1992 0 1 if $$newValuePt eq "LOAD_PREVIEW"
1998 1 2510 if ($putFirst and $dirInfo->{'HeaderPtr'}) { }
2006 5 2505 if ($entryBased) { }
2007 1 4 unless $entryBasedFixup
2016 1940 1058 if $newSize < 4
2023 289 186 if (defined $mandatory->{$newID})
2027 280 9 if (defined $mandVal and $mandVal eq $$newValuePt)
2036 80 299 if (%validateInfo)
2040 0 379 if ($ignoreCount)
2041 0 0 $ignoreCount > 1 ? :
2042 0 0 $dirInfo->{'FixBase'} ? :
2045 0 379 if ($fixCount)
2046 0 0 $fixCount > 1 ? :
2054 292 87 if ($dirEnd + 4 <= $dataLen) { }
2068 14 3 if ($allMandatory and not $isNextIFD and $newEntries < $numEntries || $numEntries == 0)
2073 13 1 if defined $deleteAll
2074 0 14 if $verbose > 1
2077 1 378 if ($ifd and not $newEntries)
2078 0 1 if $verbose
2082 1 377 if ($entryBasedFixup)
2090 56 322 if ($dirName eq "MakerNotes" and $dirInfo->{'Parent'} =~ /^(ExifIFD|IFD0)$/)
2092 13 43 if defined $pad and $pad == 0 || $pad > 4 && $pad <= 32
2099 47 331 if ($nextIfdPos)
2105 371 7 length $nextIFD ? :
2111 120 258 if (@subdirs)
2116 137 0 if ($subdirFixup)
2123 4 133 if (ref $imageData)
2127 4 0 if ($subFix)
2141 5 132 if $subdir->{'Where'} eq "valBuff"
2144 0 137 unless (&Get32u(\$newData, $offset) == 4277006349)
2155 365 13 if ($dirFixup)
2167 329 49 unless $isNextIFD
2168 42 7 if ($nextIfdOffset) { }
2173 0 7 if $verbose
2180 49 0 $dirName =~ s/(\d+)$// ? :
2185 7 42 unless $nextIfdOffset
2189 0 42 if ($et->{'PROCESSED'}{$addr})
2195 0 42 if ($dirName eq "SubIFD1" and not &ValidateIFD($dirInfo, $dirStart))
2196 0 0 if ($et->{'TIFF_TYPE'} eq 'TIFF') { }
0 0 elsif ($verbose) { }
2203 1 41 if ($et->{'DEL_GROUP'}{$dirName}) { }
2204 0 1 if $verbose
2205 0 1 if $raf
2208 0 1 if ($et->{'DEL_GROUP'}{$dirName} == 2 and $et->{'ADD_DIRS'}{$dirName}) { }
2219 0 41 if $verbose
2239 60 271 if (@offsetInfo)
2245 102 60 if ($ifd >= 0) { }
2246 32 70 unless my $offsetInfo = $offsetInfo[$ifd]
2247 0 23 if ($offsetInfo->{'273'} and $offsetInfo->{'324'})
2250 0 0 if ($dirName eq 'SubIFD' and $et->{'TIFF_TYPE'} eq 'ARW' and $offsetInfo->{'279'} and $offsetInfo->{'325'} and $offsetInfo->{'273'}[2] == 1) { }
2269 1 0 if ($stripOffsets and $stripOffsets->[0]{'PanasonicHack'} or $rawDataOffset and $rawDataOffset->[0]{'PanasonicHack'})
2274 0 1 if $err
2281 70 70 unless $tagInfo->{'IsOffset'}
2283 0 70 unless $sizeInfo
2286 24 46 if ($raf and defined $origDirInfo->{'ImageData'} and $tagID == 273 || $tagID == 324 || $sizeInfo->[3][0] && $sizeInfo->[3][0] * scalar(@{$sizeInfo->[3];}) > 1000000 and not defined $dataTag && defined $offsetData{$dataTag}) { }
2301 43 17 unless @writeLater
2310 0 70 unless ($count == $count2)
2316 0 70 if $count > 1
2318 0 70 if $n > 4
2319 0 70 if ($byteCounts < 0 or $byteCounts + $n > length $newData)
2325 2 68 if ($tagInfo->{'IsOffset'} eq '2') { }
2333 0 70 if ($tagInfo->{'WrongBase'}) { }
2345 0 70 if $tagInfo->{'ByteOrder'}
2349 68 2 if (@$oldOffset and @$oldSize)
2357 1 69 if ($tagInfo->{'PanasonicHack'}) { }
2365 68 2 if (defined $offset) { }
0 2 elsif ($size != 4277010157) { }
2374 4 66 if ($size == 4277010157) { }
24 42 elsif ($ifd < 0) { }
37 5 elsif ($offset >= 0 and $offset + $size <= $dataLen) { }
0 5 elsif ($et->{'TIFF_TYPE'} eq 'MRW') { }
4 1 elsif ($raf and $raf->Seek($offset + $dbase + $dpos, 0) and $raf->Read($buff, $size) == $size) { }
0 1 elsif ($tagInfo->{'Name'} eq 'ThumbnailOffset' and $offset >= 0 and $offset < $dataLen) { }
1 0 elsif ($tagInfo->{'Name'} eq 'PreviewImageStart' and $et->{'FILE_TYPE'} eq 'JPEG') { }
2375 0 4 unless (defined $dataTag)
2379 0 4 unless (defined $offsetData{$dataTag})
2383 0 4 if ($count > 1)
2388 0 4 if ($Image::ExifTool::Exif::formatSize[$format] != 4)
2397 0 24 if ($offsetPair->[0][6])
2398 0 0 if ($count > 1) { }
2403 0 0 if ($padToFixedOffset < 0) { }
2415 0 0 if $blockSize + $size & 1 and $n + 1 >= $count || !$oldEnd || $oldEnd != $$oldOffset[$n + 1]
2418 0 0 if ($origDirInfo->{'PreserveImagePadding'} and $n + 1 < $count and $oldEnd and $$oldOffset[$n + 1] > $oldEnd)
2427 4 20 if ($imageDataFlag eq "SubIFD" and not $subIfdDataFixup)
2440 0 0 $n & 3 ? :
2443 0 0 unless defined $ttwLen
2450 0 0 if ($et->{'TIFF_TYPE'} eq "ARW" and $tagInfo->{'Name'} eq "ThumbnailOffset" and $et->{'Model'} eq "DSLR-A100" and not $buff =~ /^\xff\xd8\xff/)
2455 0 0 if ($pos < 65536 and $raf->Seek($pos + 65536, 0) and $raf->Read($try, $size) == $size and $try =~ /^\xff\xd8\xff/) { }
2470 0 0 unless (&WriteValue($size, $formatStr, 1, \$newData, $byteCountPos))
2479 1 0 if ($r and not $raf)
2482 1 0 unless $r->Seek($offset + $base + $dataPos, 0) and $r->Read($buff, $size) == $size and $buff =~ /^.\xd8\xff[\xc4\xdb\xe0-\xef]/s
2485 0 1 unless $r->Seek($tell, 0)
2488 1 0 unless defined $buff
2491 0 0 if $et->Error("Error reading $dataName data in $name", $inMakerNotes)
2494 14 56 if ($tagInfo->{'Name'} eq "PreviewImageStart")
2495 8 6 if ($et->{'FILE_TYPE'} eq 'JPEG' and not $tagInfo->{'MakerPreview'}) { }
0 12 elsif ($et->{'TIFF_TYPE'} eq 'ARW' and $et->{'Model'} eq 'DSLR-A100') { }
2498 7 1 unless $et->{'PREVIEW_INFO'}
2501 2 6 if ($tagInfo->{'IsOffset'} and $tagInfo->{'IsOffset'} eq 2)
2504 7 1 if ($offset >= 0 and $offset + $size <= $dataLen)
2512 0 0 if $et->{'A100PreviewLength'}
2513 0 0 if defined $buff
2521 4 66 if $subIfdDataFixup
2525 0 70 if ($otherPos)
2526 0 0 if ($tagInfo->{'PanasonicHack'}) { }
0 0 elsif (ref $otherPos eq 'ARRAY') { }
2536 0 0 if $count > 1
2542 0 0 if $subIfdDataFixup
2546 46 24 if ($ifd >= 0) { }
2548 1 45 if length $buff & 1
2558 0 60 if (defined $ttwLen and $ttwLen != length $newData)
2568 0 28 if (defined $entry)
2570 0 0 if ($format < 1 or $format > 13) { }
2579 0 0 if ($imageDataFlag eq "SubIFD")
2590 4 4 if ($subFix and defined $subFix->{'BlockLen'} and $numBlocks > 0)
2603 124 207 unless ($dirInfo->{'Fixup'})
2605 121 3 $hdrPtr ? :
2612 124 0 if ($newDataPos)
2617 0 124 if $et->{'LeicaTrailer'}
2620 6 118 if ($previewInfo) { }
6 112 elsif (defined $newData and $deleteAll) { }
0 112 elsif ($et->{'A100PreviewLength'}) { }
2624 5 1 if ($$pt ne 'LOAD_PREVIEW' and length($$pt) + length($newData) + 14 <= 65533 and not $previewInfo->{'IsTrailer'} or $previewInfo->{'IsShort'}) { }
2632 0 5 if ($previewInfo->{'Relative'})
2639 0 5 unless $et->{'PREVIEW_INFO'}{'WasContained'}
2644 0 1 unless $previewInfo->{'Fixup'}
2654 6 118 if ($newDataPos == 16)
2660 0 124 if ($key)
2664 0 0 if ($start and $start - 8 + $len <= length $newData)
2672 13 318 if defined $newData and length $newData < 12
2675 0 318 if defined $newData and length $newData and $et->{'FORCE_WRITE'}{'EXIF'}