Branch Coverage

blib/lib/Image/ExifTool/Validate.pm
Criterion Covered Total %
branch 54 168 32.1


line true false branch
340 3 210 if ($tagInfo->{'Validate'})
346 0 3 if ($wrn or $err)
348 0 0 if $err
349 0 0 if $wrn
353 18 51 if (ref $tagInfo->{'PrintConv'} eq "HASH" and $tagInfo->{'Table'}{'SHORT_NAME'} eq 'GPS::Main' || $tagInfo->{'Table'} eq \%Image::ExifTool::Exif::Main && $Image::ExifTool::Validate::exifSpec{$tagInfo->{'TagID'}})
357 0 18 if $prt and $prt =~ /^Unknown \(/
359 0 213 if $val eq "undef"
360 0 213 if ($wrn)
373 3 0 if ($val =~ /^\d{4}:(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})$/) { }
0 0 elsif ($val ne ' : : : : ' and $val ne ' ') { }
377 15 0 if $a[$i] eq " " or $a[$i] >= $validDateField[$i][1] and $a[$i] <= $validDateField[$i][2]
380 0 3 if @bad
395 0 0 if ($val =~ /^\d{4}$/ or $val =~ /^\d{4}:(\d{2})$/ or $val =~ /^\d{4}:(\d{2}):(\d{2})$/ or $val =~ /^\d{4}:(\d{2}):(\d{2}) (\d{2}):(\d{2})()(Z|[-+](\d{2}):(\d{2}))?$/ or $val =~ /^\d{4}:(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})(Z|[-+](\d{2}):(\d{2}))?$/ or $val =~ /^\d{4}:(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})\.?\d*(Z|[-+](\d{2}):(\d{2}))?$/) { }
405 0 0 unless defined $a[$i]
406 0 0 if $a[$i] eq "" or $a[$i] >= $validDateField[$i][1] and $a[$i] <= $validDateField[$i][2]
409 0 0 if @bad
425 0 63 if $tag <= $lastTag
428 0 2 if (not defined $tagInfo and $tagTablePtr->{$tag} and ref $tagTablePtr->{$tag} eq "HASH")
431 61 2 if (defined $tagInfo) { }
0 2 elsif (not $otherSpec{$et->{'FileType'}} && ($otherSpec{$et->{'FileType'}}{$tag} || $otherSpec{$et->{'FileType'}}{'All'})) { }
433 1 60 if ref $ti eq "ARRAY"
435 59 2 if (defined $stdFmt->{'All'} or $tagTablePtr eq \%Image::ExifTool::Exif::Main and $Image::ExifTool::Validate::exifSpec{$tag} || $stdFmt->{$tag} || $tag >= 50706 && $tag <= 52552 && !defined($stdFmt->{$tag}) or $tagTablePtr->{'SHORT_NAME'} eq 'GPS::Main') { }
0 2 elsif ($stdFormatAnyIFD{$tag}) { }
0 2 elsif (not $otherSpec{$et->{'FileType'}} && ($otherSpec{$et->{'FileType'}}{$tag} || $otherSpec{$et->{'FileType'}}{'All'})) { }
441 0 0 if ($wgp and $wgp ne $ifd and $wgp ne "All" and not $ti->{'OffsetPair'} and $ifd =~ /^(Sub|Profile)?IFD\d*$/ ^^ $wgp =~ /^(Sub)?IFD\d*$/ and $ti->{'Writable'} || $ti->{'WriteGroup'} and not $ifd =~ /^SRF\d+$/)
448 0 0 if ($fmt and not $formatStr =~ /^$fmt$/ and !($tagInfo && $tagInfo->{'IsOffset'}) || $Image::ExifTool::Exif::intFormat{$formatStr})
454 0 0 if ($ti->{'Writable'} or $ti->{'WriteGroup'})
456 0 0 if ($wgp and $wgp ne $ifd)
463 0 0 if ($tagTablePtr eq \%Image::ExifTool::Exif::Main or $ti->{'Unknown'})
464 0 0 unless $otherSpec{$ifd}
469 4 57 if ($tiCount)
470 1 0 if ($ti->{'Format'} and $ti->{'Writable'} and $Image::ExifTool::Exif::formatNumber{$ti->{'Format'}} and $Image::ExifTool::Exif::formatNumber{$ti->{'Writable'}})
478 0 4 if ($tiCount > 0 and $count != $tiCount)
485 0 0 unless $otherSpec{$ifd}
498 0 5 unless my $fileSize = $et->{'VALUE'}{'FileSize'}
501 0 5 if $et->{'DontValidateImageData'}
503 0 0 if $et->{'TIFF_TYPE'} eq "MRW" and $dirName eq "IFD0" and $et->{'Model'} =~ /^DiMAGE A200/
505 0 5 if $et->{'TIFF_TYPE'} =~ /^(3FR|RWL|RW2)$/
514 10 6 unless ref $offsets eq "ARRAY"
516 2 4 unless (defined $id2 and $offsetInfo->{$id2})
517 2 0 unless ($offsets->[0]{'NotRealPair'} or defined $id2 and $id2 == -1)
518 1 1 $offsets->[0]{'IsOffset'} ? :
519 0 2 unless $minor
525 0 4 if $sizes->[0]{'IsOffset'}
528 0 4 if (@sizes != @offsets)
536 0 4 if $start == 0
537 0 4 if $start == $end
538 4 0 unless $end > $fileSize
539 0 0 if ($start >= $fileSize) { }
540 0 0 if ($start == 4294967295) { }
562 1 0 if $fileType eq "TIFF"
564 0 1 if ($validValue{$fileType})
568 0 0 unless $et->{'FOUND_DIR'}{$grp}
571 0 0 if ($verCheck)
574 0 0 unless $ver =~ /^\d{4}$/
578 0 0 unless $et->GetGroup($key, 1) eq $grp
579 0 0 if $et->{'TAG_EXTRA'}{$key}{'G3'}
585 0 0 unless defined $ver
587 0 0 if not defined $chk->{$tag} or $chk->{$tag} == 1 or $ver >= $chk->{$tag}
588 0 0 if ($verTag eq 'GPSVersionID') { }
601 0 0 if (defined $validValue->{$tag}) { }
604 0 0 if (not defined $result) { }
0 0 elsif ($result eq '') { }
607 0 0 defined $val ? :
609 0 0 if $result eq 1
613 0 0 unless defined $val
618 0 0 if ($info{$tag}) { }
621 0 0 $grp eq 'GPS' ? :
623 0 0 if ref $tagInfo eq "ARRAY"
624 0 0 $tagInfo ? :
626 0 0 if $et->{'WrongFormat'} and $et->{'WrongFormat'}{"${grp}:$name"}
627 0 0 $pre ? :
628 0 0 $post ? :
634 1 0 if ($et->{'FILENAME'} ne "")
635 1 0 $et->{'FILENAME'} =~ /^.*\.([^.]+)$/s ? :
637 1 0 if ($extFileType and $extFileType ne $fileType)
639 0 1 if ($normExt and $normExt ne $fileExt)
641 0 0 if (ref $lkup or $lkup ne $normExt)
648 0 1 if $et->Options("FastScan")
651 1 0 if ($mkTag)
654 0 1 $et->{'VALUE'}{'Error'} ? :
0 1 $et->{'VALUE'}{'Warning'} ? :
656 0 1 if $et->{'VALUE'}{$key} and $et->{'VALUE'}{$key} =~ /^\[minor\]/i
657 1 0 unless $key = $et->NextTagKey($key)