Branch Coverage

blib/lib/Image/ExifTool/Validate.pm
Criterion Covered Total %
branch 54 164 32.9


line true false branch
320 3 210 if ($tagInfo->{'Validate'})
326 0 3 if ($wrn or $err)
328 0 0 if $err
329 0 0 if $wrn
333 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'}})
337 0 18 if $prt and $prt =~ /^Unknown \(/
339 0 213 if $val eq "undef"
340 0 213 if ($wrn)
353 3 0 if ($val =~ /^\d{4}:(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})$/) { }
0 0 elsif ($val ne ' : : : : ' and $val ne ' ') { }
357 15 0 if $a[$i] eq " " or $a[$i] >= $validDateField[$i][1] and $a[$i] <= $validDateField[$i][2]
360 0 3 if @bad
375 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}))?$/) { }
385 0 0 unless defined $a[$i]
386 0 0 if $a[$i] eq "" or $a[$i] >= $validDateField[$i][1] and $a[$i] <= $validDateField[$i][2]
389 0 0 if @bad
405 0 63 if $tag <= $lastTag
408 0 2 if (not defined $tagInfo and $tagTablePtr->{$tag} and ref $tagTablePtr->{$tag} eq "HASH")
411 61 2 if (defined $tagInfo) { }
0 2 elsif (not $otherSpec{$et->{'VALUE'}{'FileType'}} && ($otherSpec{$et->{'VALUE'}{'FileType'}}{$tag} || $otherSpec{$et->{'VALUE'}{'FileType'}}{'All'})) { }
413 1 60 if ref $ti eq "ARRAY"
415 59 2 if (defined $stdFmt->{'All'} or $tagTablePtr eq \%Image::ExifTool::Exif::Main and $Image::ExifTool::Validate::exifSpec{$tag} || $stdFmt->{$tag} || $tag >= 50706 && $tag <= 51125 && !defined($stdFmt->{$tag}) or $tagTablePtr->{'SHORT_NAME'} eq 'GPS::Main') { }
0 2 elsif ($stdFormatAnyIFD{$tag}) { }
0 2 elsif (not $otherSpec{$et->{'VALUE'}{'FileType'}} && ($otherSpec{$et->{'VALUE'}{'FileType'}}{$tag} || $otherSpec{$et->{'VALUE'}{'FileType'}}{'All'})) { }
421 0 0 if ($wgp and $wgp ne $ifd and $wgp ne "All" and not $ti->{'OffsetPair'} and ($ifd =~ /^(Sub|Profile)?IFD\d*$/ xor $wgp =~ /^(Sub)?IFD\d*$/) and $ti->{'Writable'} || $ti->{'WriteGroup'} and not $ifd =~ /^SRF\d+$/)
428 0 0 if ($fmt and not $formatStr =~ /^$fmt$/ and !($tagInfo && $tagInfo->{'IsOffset'}) || $Image::ExifTool::Exif::intFormat{$formatStr})
434 0 0 if ($ti->{'Writable'} or $ti->{'WriteGroup'})
436 0 0 if ($wgp and $wgp ne $ifd)
443 0 0 if ($tagTablePtr eq \%Image::ExifTool::Exif::Main or $tagInfo->{'Unknown'})
449 4 57 if ($tiCount)
450 1 0 if ($ti->{'Format'} and $ti->{'Writable'} and $Image::ExifTool::Exif::formatNumber{$ti->{'Format'}} and $Image::ExifTool::Exif::formatNumber{$ti->{'Writable'}})
458 0 4 if ($tiCount > 0 and $count != $tiCount)
478 0 5 unless my $fileSize = $et->{'VALUE'}{'FileSize'}
481 0 5 if $et->{'DontValidateImageData'}
483 0 0 if $et->{'TIFF_TYPE'} eq "MRW" and $dirName eq "IFD0" and $et->{'Model'} =~ /^DiMAGE A200/
485 0 5 if $et->{'TIFF_TYPE'} =~ /^(3FR|RWL|RW2)$/
494 10 6 unless ref $offsets eq "ARRAY"
496 2 4 unless (defined $id2 and $offsetInfo->{$id2})
497 2 0 unless ($offsets->[0]{'NotRealPair'} or defined $id2 and $id2 == -1)
498 1 1 $offsets->[0]{'IsOffset'} ? :
499 0 2 unless $minor
505 0 4 if $sizes->[0]{'IsOffset'}
508 0 4 if (@sizes != @offsets)
516 0 4 if $start == 0
517 0 4 if $start == $end
518 4 0 unless $end > $fileSize
519 0 0 if ($start >= $fileSize) { }
520 0 0 if ($start == 4294967295) { }
542 1 0 if $fileType eq "TIFF"
544 0 1 if ($validValue{$fileType})
548 0 0 unless $et->{'FOUND_DIR'}{$grp}
551 0 0 if ($verCheck)
554 0 0 unless $ver =~ /^\d{4}$/
558 0 0 unless $et->GetGroup($key, 1) eq $grp
559 0 0 if $et->{'TAG_EXTRA'}{$key} and $et->{'TAG_EXTRA'}{$key}{'G3'}
565 0 0 unless defined $ver
567 0 0 if not defined $chk->{$tag} or $chk->{$tag} == 1 or $ver >= $chk->{$tag}
568 0 0 if ($verTag eq 'GPSVersionID') { }
581 0 0 if (defined $validValue->{$tag}) { }
584 0 0 if (not defined $result) { }
0 0 elsif ($result eq '') { }
587 0 0 defined $val ? :
589 0 0 if $result eq 1
593 0 0 unless defined $val
598 0 0 if ($info{$tag}) { }
601 0 0 $grp eq 'GPS' ? :
603 0 0 if ref $tagInfo eq "ARRAY"
604 0 0 $tagInfo ? :
606 0 0 if $et->{'WrongFormat'} and $et->{'WrongFormat'}{"${grp}:$name"}
607 0 0 $pre ? :
608 0 0 $post ? :
614 1 0 if ($et->{'FILENAME'} ne "")
615 1 0 $et->{'FILENAME'} =~ /^.*\.([^.]+)$/s ? :
617 1 0 if ($extFileType and $extFileType ne $fileType)
619 0 1 if ($normExt and $normExt ne $fileExt)
621 0 0 if (ref $lkup or $lkup ne $normExt)
628 0 1 if $et->Options("FastScan")
631 1 0 if ($mkTag)
634 0 1 $et->{'VALUE'}{'Error'} ? :
0 1 $et->{'VALUE'}{'Warning'} ? :
636 0 1 if $et->{'VALUE'}{$key} and $et->{'VALUE'}{$key} =~ /^\[minor\]/i
637 1 0 unless $key = $et->NextTagKey($key)