Branch Coverage

blib/lib/Image/ExifTool/WriteExif.pl
Criterion Covered Total %
branch 579 1020 56.7


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 129 6214 if (not $format or $format eq 1)
117 129 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 0 23 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 8375 335 unless $et
556 36 299 unless ($dataPt)
579 157 8 unless $name and $dirName eq "MakerNotes" and not $name =~ /^MakerNote/
582 201 134 if $dirName eq "IFD0" or $dirName eq "ExifIFD"
585 260 75 if $tagTablePtr->{'GROUPS'}{'0'} eq "EXIF"
588 118 217 if $dirName =~ /^(IFD0|SubIFD)$/ and not defined $dirInfo->{'Multi'}
589 74 261 if $tagTablePtr->{'GROUPS'}{'0'} eq "MakerNotes"
605 122 261 if ($dirStart < 0 or $dirStart > $dataLen - 2) { }
261 0 elsif ($dirLen >= 2) { }
609 0 261 if $dirStart + $len > $dataLen
612 122 261 if ($mustRead)
613 38 84 if ($raf) { }
0 168 elsif ($dirLen and $dirStart + 4 >= $dataLen) { }
617 0 38 unless ($raf->Seek($offset + $base, 0) and $raf->Read($buff, 2) == 2)
622 0 38 unless ($raf->Read($buf2, $len + 4) >= $len)
636 38 0 if $dataLen == $len + 6 and $dirInfo->{'Multi'} || $buff =~ /\0{4}$/
641 0 0 $et->Options('IgnoreMinorErrors') ? :
646 292 91 if ($dirStart + 4 < $dataLen) { }
649 0 292 if ($dirEnd > $dataLen)
652 0 0 unless $n and defined $rtn
661 128 6 if $tagID < $lastID and $tagID || $tagTablePtr->{'0'}
665 0 292 if ($unsorted and not $inMakerNotes || $et->IsRawType)
683 168 1889 ref $tagTablePtr->{$tagID} eq 'ARRAY' || $tagInfo->{'Condition'} ? :
687 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))
695 0 2 if $et->{'FORCE_WRITE'}{'FixBase'}
696 0 0 if ($et->{'TIFF_TYPE'} eq "SRW" and $et->{'Make'} eq "SAMSUNG" and $et->{'Model'} eq "EK-GN120")
703 383 0 unless $noMandatory
704 297 86 if ($mandatory) { }
706 6 291 if ($dirName eq "IFD0" and defined $et->{'JFIFYResolution'})
715 91 206 unless ($numEntries)
717 136 38 unless defined $set{$_}
724 74 309 if ($inMakerNotes) { }
731 5 36 unless $set{$_}
733 0 36 if defined $perm and not $perm
735 0 74 if @newTags > 1
759 0 383 if ($inMakerNotes and $et->{'Model'} eq "Canon EOS 40D")
761 0 0 if ($fmt < 1 or $fmt > 13)
774 5104 1918 if (defined $oldID and $oldID == $newID)
778 4721 383 if ($index < $numEntries) { }
784 0 0 if ($oldFormat < 1 || $oldFormat > 13 and $oldFormat != 129 and not $oldFormat == 16 && $et->{'Make'} eq 'Apple' && $inMakerNotes)
789 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)
800 0 0 if ($oldFormat == 0 and $index and $oldCount == 0)
803 0 0 if $dirInfo->{'FixBase'}
817 585 4136 if (ref $oldInfo ne "HASH" or $oldInfo->{'Condition'})
825 0 2803 if ($oldCount < 2 and $oldInfo and $oldInfo->{'FixCount'})
826 0 0 unless $offList
829 0 0 if (defined $i and $i < $offList->$#*)
831 0 0 if $oldCount != $readCount
836 2151 2570 if ($oldSize > 4)
839 0 2151 if ($dirInfo->{'FixOffsets'})
840 0 0 unless $valEnd
844 0 0 unless (defined $valuePtr)
845 0 0 unless ($et->{'DropTags'})
846 0 0 $oldInfo ? :
847 0 0 if $et->Error("Bad $name offset for $tagStr", $inMakerNotes)
855 5 2146 if ($dirInfo->{'EntryBased'} or ref $tagTablePtr->{$oldID} eq 'HASH' and $tagTablePtr->{$oldID}{'EntryBased'}) { }
863 0 2151 if $valuePtr < $dirEnd and $valuePtr + $oldSize > $dirStart
865 226 1925 if ($valuePtr < 0 or $valuePtr + $oldSize > $dataLen)
867 218 8 if ($oldInfo) { }
8 0 elsif (defined $oldInfo) { }
872 8 0 if ($tmpInfo)
877 0 226 unless $tagStr
879 0 226 unless ($raf)
880 0 0 if ($tagStr eq 'PreviewImage') { }
0 0 elsif ($leicaTrailer) { }
882 0 0 if ($raf) { }
884 0 0 if ($oldInfo and $oldInfo->{'ChangeBase'})
903 0 0 unless $oldInfo
909 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) { }
916 0 0 unless (defined $set{$oldID})
917 0 0 $oldSize & 1 ? :
924 0 226 if (defined $pos)
928 0 0 unless ($success and $oldValue =~ /^(\xff\xd8\xff|(.|.{33})\xd8\xff\xdb)/s)
933 0 226 unless ($success)
936 0 0 if ($oldInfo and not $oldInfo->{'Unknown'})
940 0 0 if $et->Error($wrn, $inMakerNotes || $truncOK)
941 0 0 unless ($truncOK)
946 0 0 if $et->Error("Bad $name offset for $tagStr", $inMakerNotes)
949 0 226 if ($invalidPreview) { }
951 0 0 if ($et->{'FILE_TYPE'} eq 'JPEG') { }
971 2 2149 if ($suspect)
972 2 0 $oldInfo ? :
974 2 0 if ($inMakerNotes) { }
977 0 0 if $et->Error($str, 1)
982 4495 226 unless $readFromFile
984 162 4559 if (defined $oldInfo and not $oldInfo)
990 0 0 if ($mayDelete{$oldID} and $oldInfo and !@newTags || $newTags[0] != $oldID)
992 0 0 if (not $nvHash and $wrongDir)
995 0 0 if $nvHash
997 0 0 if ($nvHash)
1005 0 4721 if ($oldFormat == 13 || $oldFormat == 18 and not $oldInfo && $oldInfo->{'SubIFD'})
1012 4721 0 if ($oldInfo)
1014 0 4721 if ($oldInfo->{'IsOffset'} || $oldInfo->{'SubIFD'} and not $Image::ExifTool::Exif::intFormat{$oldFormName})
1020 4 0 if ($oldInfo->{'Drop'} and $et->{'DropTags'} and $oldInfo->{'Drop'} == 1 || $oldInfo->{'Drop'} < $oldSize)
1025 289 4428 if ($oldInfo->{'Format'})
1028 0 289 unless ($readFormat)
1033 0 289 if ($oldInfo->{'FixedSize'})
1034 0 0 if $oldInfo->{'FixedSize'}
1041 0 4717 if ($oldID <= $lastTagID and not $inMakerNotes || $et->IsRawType)
1042 0 0 $oldInfo ? :
1043 0 0 if ($oldID == $lastTagID) { }
1046 0 0 if defined $set{$oldID}
1062 2140 4878 if (not defined $oldID) { }
3252 1626 elsif (not defined $newID) { }
1063 383 1757 unless defined $newID
1067 35 3217 if (defined $set{$oldID}) { }
1076 0 1626 if ($unsorted and $isNew)
1077 0 0 if ($isNew > 0 and $hasOldID{$newID})
1082 0 0 if ($isNew < 0 and $hasNewID{$oldID})
1099 2201 4434 $isNew >= 0 ? :
1102 2201 4434 if ($isNew >= 0)
1107 0 22 if $newID == 37500 and $isNew > 0 and $et->{'FileType'} eq "CR3"
1108 110 72 unless ($curInfo or $addDirs->{$newID})
1113 24 86 if (defined $curInfo and not $curInfo)
1118 501 25 unless $tagInfo->{'TagID'} == $newID
1120 0 25 unless defined $val
1123 24 1 if ($fmt)
1125 0 24 unless defined $val
1128 25 0 if ($curInfo)
1129 21 4 if $curInfo eq $tagInfo
1134 3 21 unless $curInfo
1137 83 27 if ($curInfo and $et->{'NEW_VALUE'}{$curInfo}) { }
1140 26 1 if $isNew > 0
1145 2102 73 if ($curInfo) { }
1 72 elsif (not $addDirs->{$newID}) { }
1146 6 2096 if ($curInfo->{'WriteCondition'})
1149 0 6 unless (eval $curInfo->{'WriteCondition'})
1150 0 0 if $@
1155 2102 0 if $isNew >= 0
1156 1100 148 unless ($nvHash or defined $mandatory->{$newID} and not $noMandatory)
1157 435 665 unless $wrongDir
1161 29 636 unless $et->IsOverwriting($nvHash)
1165 2 634 if (not defined $nvHash->{'Value'} and $nvHash->{'WantGroup'} and lc $nvHash->{'WantGroup'} eq lc $wrongDir) { }
1175 464 3 if $isNew > 0
1179 1636 75 if ($set{$newID}) { }
42 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}) { }
1187 1386 250 if ($isNew > 0) { }
241 9 elsif ($nvHash or $xDelete{$newID}) { }
1189 616 770 if ($nvHash) { }
1190 86 530 unless $nvHash->{'IsCreating'}
1191 1 529 if ($newInfo->{'IsOverwriting'}) { }
1198 631 139 if $xDelete{$newID}
1203 73 596 if ($newInfo->{'Format'}) { }
1209 0 596 unless ($newFormName)
1216 3 238 unless ($nvHash)
1220 241 0 if (length $oldValue >= $oldSize) { }
1228 2 239 unless $writable and $writable ne 1
1231 8 233 if ($writeForm ne $newFormName)
1236 2 6 if ($inMakerNotes) { }
2 4 elsif ($writable ne $newFormName) { }
1244 26 9 if ($inMakerNotes and $readFormName ne "string" and $readFormName ne "undef")
1248 1 240 if ($newInfo->{'IsOverwriting'}) { }
1255 904 15 if ($isOverwriting) { }
1256 763 141 unless defined $newVal
1259 22 882 if (not defined $newVal or $xDelete{$newID} and not defined $nvHash->{'Shift'})
1260 0 20 if (not defined $newVal and $newInfo->{'RawConvInv'} and defined $nvHash->{'Value'})
1264 22 0 unless ($isNew)
1270 19 863 if ($newCount and $newCount < 0)
1277 0 882 unless (defined $newValue)
1281 882 0 if (length $newValue) { }
1284 0 686 if ($et->{'FILE_TYPE'} eq "JPEG" and length $newValue > 65436 and $newInfo->{'Name'} ne "PreviewImage")
1287 0 0 $newInfo->{'MakerNotes'} ? :
1291 0 882 if ($newFormName eq 'utf8') { }
1 1761 elsif ($strEnc and $newFormName eq 'string') { }
1300 882 0 if ($isNew >= 0)
1303 153 729 if (defined $allMandatory)
1305 82 71 if ($nvHash) { }
1312 10 872 if ($verbose > 1)
1313 0 10 unless $isNew
1314 0 10 if ($newInfo->{'OffsetPair'} and $newVal eq '4277010157') { }
1317 8 2 $nvHash ? :
1323 0 15 if $isNew > 0
1327 76 821 if ($ifdFormName)
1338 0 42 unless $newInfo = $addDirs->{$newID}
1341 0 42 if $newInfo->{'MakerNotes'} or $newInfo->{'Name'} eq "SubIFD"
1343 15 27 if ($newInfo->{'SubDirectory'}{'TagTable'}) { }
1353 38 4 if $newInfo->{'SubIFD'}
1356 2 40 unless defined $newValue and length $newValue
1358 36 4 if ($newInfo->{'SubIFD'}) { }
1376 0 4 unless ($newFormName and $Image::ExifTool::Exif::formatNumber{$newFormName})
1392 4452 952 if ($isNew < 0)
1400 0 4452 if ($oldImageData)
1406 5404 0 if ($newInfo)
1410 8 5396 if ($newInfo->{'DataTag'} and $isNew >= 0)
1413 4 4 unless (defined $offsetData{$dataTag} or $dataTag eq "LeicaTrailer")
1419 4 0 if (defined $offsetData{$dataTag}) { }
1421 2 2 if ($dataTag eq "PreviewImage")
1423 2 0 if $len <= 4
1428 0 4 if ($err)
1429 0 0 if $newInfo->{'IsOffset'}
1438 43 5361 if ($newInfo->{'MakerNotes'}) { }
442 4919 elsif ($newInfo->{'SubDirectory'} and $isNew <= 0 and not $isOverwriting and !defined($newInfo->{'Writable'}) || $newInfo->{'Writable'} and not $newInfo->{'ReadFromRAF'}) { }
158 4761 elsif ($newInfo->{'OffsetPair'}) { }
272 4489 elsif ($newInfo->{'DataMember'}) { }
1440 1 0 if ($et->{'DEL_GROUP'}{'MakerNotes'} and $et->{'DEL_GROUP'}{'MakerNotes'} != 2 || $isNew <= 0)
1443 0 1 if ($et->IsRawType and not $et->IsRawType == 2 && $dirName eq 'ExifIFD') { }
1446 1 0 if ($isNew <= 0)
1448 0 1 if $verbose
1454 7 35 if ($isNew >= 0 and defined $set{$newID}) { }
1458 6 1 if ($nvHash and $nvHash->{'MAKER_NOTE_FIXUP'})
1481 35 0 if ($newInfo->{'SubDirectory'})
1483 4 31 if $sub->{'FixBase'}
1486 5 30 if defined $sub->{'Base'}
1488 34 1 if $sub->{'ByteOrder'}
1491 35 0 if ($oldInfo and $oldInfo->{'SubDirectory'}) { }
1493 35 0 if $subTable
1499 35 0 if $subTable
1500 0 35 unless $subTable
1501 0 35 if ($writeProc and $writeProc eq \&Image::ExifTool::MakerNotes::WriteUnknownOrPreview and $oldValue =~ /^\xff\xd8\xff/) { }
33 2 elsif (not $notIFD) { }
1510 33 2 if (defined $loc) { }
1 1 elsif ($subTable->{'PROCESS_PROC'} and $subTable->{'PROCESS_PROC'} eq \&Image::ExifTool::ProcessBinaryData) { }
1 0 elsif ($notIFD) { }
1516 1 32 if ($changed == $et->{'CHANGED'} and $subdirInfo{'Fixup'}->IsEmpty)
1524 1 0 if (defined $sub->{'Start'}) { }
1536 1 0 if ($writeProc)
1542 0 0 if ($et->{'FILE_TYPE'} eq 'JPEG') { }
1548 34 1 if (defined $subdir)
1549 0 34 unless length $subdir
1556 5 29 if ($subdirInfo{'Relative'}) { }
29 0 elsif (not defined $subdirInfo{'Relative'}) { }
1563 0 5 if ($previewInfo)
1566 0 0 unless /_PreviewImage$/
1583 1 28 if ($subdirInfo{'AutoFix'}) { }
0 28 elsif ($subdirInfo{'FixBase'} and $baseShift < 0 and !$subdirInfo{'MinOffset'} || $subdirInfo{'MinOffset'} + $baseShift < 0) { }
1590 0 0 if (not defined $fixBase) { }
0 0 elsif ($fixBase eq '') { }
1591 0 0 $et->Options('IgnoreMinorErrors') ? :
1603 4 25 if ($previewInfo and not $previewInfo->{'NoBaseShift'})
1620 106 336 if ($newInfo->{'SubIFD'}) { }
336 0 elsif (!defined($subdir->{'Start'}) || $subdir->{'Start'} =~ /\$valuePtr/ and $subdir->{'TagTable'}) { }
1625 15 91 if ($subdir->{'TagTable'})
1631 8 98 if $subTable->{'GROUPS'}{'0'} eq "MakerNotes"
1634 0 106 unless ($readCount)
1635 0 0 if $et->Error("$name entry $index has zero count", 2)
1648 109 0 if (defined $subdir->{'Start'})
1651 0 109 unless (&Image::ExifTool::IsInt($newStart))
1659 0 109 if ($subdir->{'Base'})
1665 3 106 if $i
1674 67 42 $imageDataFlag eq 'Main' ? :
1683 55 54 if $newInfo->{'SubIFD'} == 2
1684 0 109 if ($subdir->{'RelativeBase'})
1690 15 94 if ($subdirStart < 0 or $subdirStart + 2 > $dataLen)
1691 15 0 if ($raf) { }
1698 0 0 if ($subTable->{'VARS'} and $subTable->{'VARS'}{'MINOR_ERRORS'}) { }
0 0 elsif ($et->Error(@err)) { }
1707 0 109 unless (defined $subdirData)
1709 0 0 unless $et->{'VALUE'}{'Error'}
1713 0 0 if ($hdrLen and $hdrLen > 0 and $subdirStart <= $dataLen)
1717 6 103 unless (length $subdirData)
1718 6 0 unless $inMakerNotes
1726 4 99 if (ref $subdirInfo{'ImageData'})
1734 5 98 if ($readCount > 1) { }
1752 6 100 unless length $newValue
1755 0 100 if ($writeCount < $readCount and $writeCount == 1)
1773 4 332 if ($subdir->{'Start'})
1780 1 335 if ($subdir->{'Base'})
1799 0 336 unless ($oldSize)
1810 22 314 if $subdir->{'ByteOrder'}
1813 274 62 if (defined $newValue) { }
1815 3 271 if ($hdrLen)
1823 1 335 unless (length $$newValuePt)
1825 1 0 if $oldSize or not $inMakerNotes
1827 5 330 if ($subFixup->{'Pointers'} and $subdirInfo{'Base'} == $base) { }
1841 10 148 if ($dataTag eq 'CanonVRD') { }
7 141 elsif ($dataTag eq 'OriginalDecisionData') { }
1844 1 9 if ($et->{'NEW_VALUE'}{$Image::ExifTool::Extra{'CanonVRD'}}) { }
0 9 elsif ($et->{'DEL_GROUP'}{'CanonVRD'} or $et->{'DEL_GROUP'}{'Trailer'}) { }
1846 1 0 $et->GetNewValue('CanonVRD') ? :
1854 1 9 if ($hasVRD) { }
1868 1 6 if ($oddInfo and $et->{'NEW_VALUE'}{$oddInfo}) { }
1 5 elsif ($$newValuePt ne "\000\000\000\000") { }
1870 0 1 if ($verbose > 1)
1871 0 0 if $$newValuePt ne "\0\0\0\0"
1872 0 0 if $odd
1876 1 0 if (length $$newValuePt == 4) { }
1880 0 1 unless $et->{'FILE_TYPE'} eq "JPEG"
1882 1 0 if ref $odd
1887 2 5 if ($odd) { }
1890 1 1 if $et->{'FILE_TYPE'} eq "JPEG"
1902 137 4 if ($isNew <= 0)
1905 0 137 if $newInfo->{'ByteOrder'}
1908 68 69 unless $newInfo->{'IsOffset'}
1911 0 0 if ($Image::ExifTool::Exif::formatSize[$newFormat] != 4 and $newInfo->{'IsOffset'})
1912 0 0 if $isNew > 0
1913 0 0 if $newCount != $readCount
1918 0 0 unless (defined $newValue)
1924 70 71 unless $offsetInfo
1929 0 141 unless $newCount
1940 0 272 if ($newInfo->{'Format'} and $newInfo->{'Format'} ne $formatStr)
1944 0 0 if $format
1948 272 0 if ($conv) { }
1950 0 272 if (ref $conv eq 'CODE') { }
1970 5396 0 unless $oldInfo and $oldInfo->{'FixedSize'}
1971 153 5243 if ($Image::ExifTool::Exif::saveForValidate{$newID} and $tagTablePtr eq \%Image::ExifTool::Exif::Main)
1975 2447 2949 if ($newSize > 4) { }
1983 5 2442 if ($dirInfo->{'EntryBased'} or $newInfo and $newInfo->{'EntryBased'}) { }
1990 2447 0 if $newInfo
1991 2 2445 if ($dataTag)
1992 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'}) { }
1997 1 0 unless $et->{'PREVIEW_INFO'}
2000 0 1 if $newInfo->{'ChangeBase'}
2001 0 1 if ($newInfo->{'IsOffset'} and $newInfo->{'IsOffset'} eq 2)
2005 0 1 if $$newValuePt eq "LOAD_PREVIEW"
2011 1 2446 if ($putFirst and $dirInfo->{'HeaderPtr'}) { }
2019 5 2441 if ($entryBased) { }
2020 1 4 unless $entryBasedFixup
2029 1910 1039 if $newSize < 4
2036 186 188 if (defined $mandatory->{$newID})
2040 177 9 if (defined $mandVal and $mandVal eq $$newValuePt)
2049 80 303 if (%validateInfo)
2053 0 383 if ($ignoreCount)
2054 0 0 $ignoreCount > 1 ? :
2055 0 0 $dirInfo->{'FixBase'} ? :
2058 0 383 if ($fixCount)
2059 0 0 $fixCount > 1 ? :
2067 292 91 if ($dirEnd + 4 <= $dataLen) { }
2081 14 3 if ($allMandatory and not $isNextIFD and $newEntries < $numEntries || $numEntries == 0)
2086 13 1 if defined $deleteAll
2087 0 14 if $verbose > 1
2090 1 382 if ($ifd and not $newEntries)
2091 0 1 if $verbose
2095 1 381 if ($entryBasedFixup)
2103 56 326 if ($dirName eq "MakerNotes" and $dirInfo->{'Parent'} =~ /^(ExifIFD|IFD0)$/)
2105 13 43 if defined $pad and $pad == 0 || $pad > 4 && $pad <= 32
2112 47 335 if ($nextIfdPos)
2118 375 7 length $nextIFD ? :
2124 122 260 if (@subdirs)
2129 139 0 if ($subdirFixup)
2136 4 135 if (ref $imageData)
2140 4 0 if ($subFix)
2154 5 134 if $subdir->{'Where'} eq "valBuff"
2157 0 139 unless (&Get32u(\$newData, $offset) == 4277006349)
2168 369 13 if ($dirFixup)
2180 333 49 unless $isNextIFD
2181 42 7 if ($nextIfdOffset) { }
2186 0 7 if $verbose
2193 49 0 $dirName =~ s/(\d+)$// ? :
2198 7 42 unless $nextIfdOffset
2202 0 42 if ($et->{'PROCESSED'}{$addr})
2208 0 42 if ($dirName eq "SubIFD1" and not &ValidateIFD($dirInfo, $dirStart))
2209 0 0 if ($et->{'TIFF_TYPE'} eq 'TIFF') { }
0 0 elsif ($verbose) { }
2216 1 41 if ($et->{'DEL_GROUP'}{$dirName}) { }
2217 0 1 if $verbose
2218 0 1 if $raf
2221 0 1 if ($et->{'DEL_GROUP'}{$dirName} == 2 and $et->{'ADD_DIRS'}{$dirName}) { }
2232 0 41 if $verbose
2240 0 0 if ($et->{'HiddenData'} and not $dirInfo->{'Fixup'} and $et->{'FILE_TYPE'} eq "TIFF")
2244 0 0 if ($raf->Seek($hd->{'Offset'}, 0) and $raf->Read($hbuf, $hd->{'Size'}) == $hd->{'Size'} and $hbuf =~ /^\x55\x26\x11\x05\0/) { }
2265 60 275 if (@offsetInfo)
2271 102 60 if ($ifd >= 0) { }
2273 42 60 if ($ifd)
2277 32 70 unless my $offsetInfo = $offsetInfo[$ifd]
2278 0 23 if ($offsetInfo->{'273'} and $offsetInfo->{'324'})
2281 0 0 if ($dirName eq 'SubIFD' and $et->{'TIFF_TYPE'} eq 'ARW' and $offsetInfo->{'279'} and $offsetInfo->{'325'} and $offsetInfo->{'273'}[2] == 1) { }
2286 0 0 if ($offsetInfo->{'273'}[3][0] == $offsetInfo->{'324'}[3][0])
2303 1 0 if ($stripOffsets and $stripOffsets->[0]{'PanasonicHack'} or $rawDataOffset and $rawDataOffset->[0]{'PanasonicHack'})
2308 0 1 if $err
2315 70 70 unless $tagInfo->{'IsOffset'}
2317 0 70 unless $sizeInfo
2320 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}) { }
2335 43 17 unless @writeLater
2344 0 70 unless ($count == $count2)
2350 0 70 if $count > 1
2352 0 70 if $n > 4
2353 0 70 if ($byteCounts < 0 or $byteCounts + $n > length $newData)
2359 2 68 if ($tagInfo->{'IsOffset'} eq '2') { }
2367 0 70 if ($tagInfo->{'WrongBase'}) { }
2379 0 70 if $tagInfo->{'ByteOrder'}
2383 68 2 if (@$oldOffset and @$oldSize)
2391 1 69 if ($tagInfo->{'PanasonicHack'}) { }
2399 68 2 if (defined $offset) { }
0 2 elsif ($size != 4277010157) { }
2408 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') { }
2409 0 4 unless (defined $dataTag)
2413 0 4 unless (defined $offsetData{$dataTag})
2417 0 4 if ($count > 1)
2422 0 4 if ($Image::ExifTool::Exif::formatSize[$format] != 4)
2431 0 24 if ($offsetPair->[0][6])
2432 0 0 if ($count > 1) { }
2439 0 0 if ($padToFixedOffset < 0) { }
2451 0 0 if $blockSize + $size & 1 and $n + 1 >= $count || !$oldEnd || $oldEnd != $$oldOffset[$n + 1]
2454 0 0 if ($origDirInfo->{'PreserveImagePadding'} and $n + 1 < $count and $oldEnd and $$oldOffset[$n + 1] > $oldEnd)
2463 4 20 if ($imageDataFlag eq "SubIFD" and not $subIfdDataFixup)
2476 0 0 $n & 3 ? :
2479 0 0 unless defined $ttwLen
2486 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/)
2491 0 0 if ($pos < 65536 and $raf->Seek($pos + 65536, 0) and $raf->Read($try, $size) == $size and $try =~ /^\xff\xd8\xff/) { }
2506 0 0 unless (&WriteValue($size, $formatStr, 1, \$newData, $byteCountPos))
2515 1 0 if ($r and not $raf)
2518 1 0 unless $r->Seek($offset + $base + $dataPos, 0) and $r->Read($buff, $size) == $size and $buff =~ /^.\xd8\xff[\xc4\xdb\xe0-\xef]/s
2521 0 1 unless $r->Seek($tell, 0)
2524 1 0 unless defined $buff
2527 0 0 if $et->Error("Error reading $dataName data in $name", $inMakerNotes)
2530 14 56 if ($tagInfo->{'Name'} eq "PreviewImageStart")
2531 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') { }
2532 5 3 if ($size)
2535 4 1 unless $et->{'PREVIEW_INFO'}
2538 1 4 if ($tagInfo->{'IsOffset'} and $tagInfo->{'IsOffset'} eq 2)
2541 5 0 if ($offset >= 0 and $offset + $size <= $dataLen)
2550 0 0 if $et->{'A100PreviewLength'}
2551 0 0 if defined $buff
2559 4 66 if $subIfdDataFixup
2563 0 70 if ($otherPos)
2564 0 0 if ($tagInfo->{'PanasonicHack'}) { }
0 0 elsif (ref $otherPos eq 'ARRAY') { }
2574 0 0 if $count > 1
2580 0 0 if $subIfdDataFixup
2584 46 24 if ($ifd >= 0) { }
2586 1 45 if length $buff & 1
2596 0 60 if (defined $ttwLen and $ttwLen != length $newData)
2606 0 28 if (defined $entry)
2608 0 0 if ($format < 1 or $format > 13) { }
2617 0 0 if ($imageDataFlag eq "SubIFD")
2628 4 4 if ($subFix and defined $subFix->{'BlockLen'} and $numBlocks > 0)
2641 126 209 unless ($dirInfo->{'Fixup'})
2643 123 3 $hdrPtr ? :
2650 126 0 if ($newDataPos)
2655 0 126 if $et->{'LeicaTrailer'}
2656 0 126 if $et->{'HiddenData'}
2659 5 121 if ($previewInfo) { }
6 115 elsif (defined $newData and $deleteAll) { }
0 115 elsif ($et->{'A100PreviewLength'}) { }
2663 5 0 if ($$pt ne 'LOAD_PREVIEW' and length($$pt) + length($newData) + 14 <= 65533 and not $previewInfo->{'IsTrailer'} or $previewInfo->{'IsShort'}) { }
2671 0 5 if ($previewInfo->{'Relative'})
2678 0 5 unless $et->{'PREVIEW_INFO'}{'WasContained'}
2683 0 0 unless $previewInfo->{'Fixup'}
2693 6 120 if ($newDataPos == 16)
2699 0 126 if ($key)
2703 0 0 if ($start and $start - 8 + $len <= length $newData)
2711 13 322 if defined $newData and length $newData < 12
2714 0 322 if defined $newData and length $newData and $et->{'FORCE_WRITE'}{'EXIF'}