Branch Coverage

blib/lib/Image/ExifTool/Photoshop.pm
Criterion Covered Total %
branch 58 230 25.2


line true false branch
641 0 0 if $i + $n >= $len
642 0 0 if $i
662 0 4 unless $fileType eq "PSD" or $fileType eq "PSB"
665 0 4 $fileType eq 'PSB' ? :
669 0 4 unless $raf->Read($data, $n) == $n
670 0 4 $psb ? :
671 0 4 if $tot == 0
674 0 4 $psb ? :
677 4 0 if ($len == 0 and $num == 0)
678 0 4 unless $raf->Read($data, 10) == 10
679 0 4 if ($data =~ /^..8BIMLr16/s) { }
0 4 elsif ($data =~ /^..8BIMMt16/s) { }
680 0 0 unless $raf->Read($data, $psiz + 2) == $psiz + 2
681 0 0 $psb ? :
683 0 0 unless $raf->Read($data, $psiz) == $psiz
684 0 0 unless $raf->Read($data, 8) == 8
685 0 0 if ($data eq '8BIMLr16') { }
686 0 0 unless $raf->Read($data, $psiz + 2) == $psiz + 2
687 0 0 $psb ? :
689 0 0 unless $raf->Seek(-18 - $psiz, 1)
692 0 4 unless $raf->Seek(-10, 1)
696 0 4 unless $raf->Seek(-2, 1)
705 4 0 $raf->Seek($end, 0) ? :
723 0 4 if $dirLen < 2
724 0 4 unless $raf->Read($buff, 2) == 2
726 0 4 if $num < 0
734 0 4 $psb ? :
737 0 0 if $pos + 18 > $dirLen
738 0 0 unless $raf->Read($buff, 18) == 18
744 0 0 unless $raf->Seek($n, 1)
746 0 0 if $pos + 20 > $dirLen
747 0 0 unless $raf->Read($buff, 20) == 20
750 0 0 unless $sig =~ /^(8BIM|MIB8)$/
756 0 0 if $pos + 4 > $dirLen
757 0 0 unless $raf->Seek($n, 1) and $raf->Read($buff, 4) == 4
760 0 0 if $pos + 1 > $dirLen
761 0 0 unless $raf->Seek($n, 1) and $raf->Read($buff, 1) == 1
763 0 0 if $pos + 1 + $n > $dirLen
764 0 0 unless $raf->Read($buff, $n) == $n
768 0 0 if $frag
773 0 0 unless $raf->Read($buff, 12) == 12
775 0 0 if &GetByteOrder() eq "II"
777 0 0 unless $sig eq "8BIM" or $sig eq "8B64"
782 0 0 if ($psb and $tag =~ /^(LMsk|Lr16|Lr32|Layr|Mt16|Mt32|Mtrn|Alph|FMsk|lnk2|FEid|FXid|PxSD)$/) { }
783 0 0 if $pos + 16 > $nxt
784 0 0 unless $raf->Read($buf2, 4) == 4
792 0 0 if $pos + $n > $nxt
794 0 0 if ($tagTablePtr->{$tag} or $verbose) { }
796 0 0 unless defined $count{$tag}
797 0 0 unless $raf->Read($buff, $n) == $n
805 0 0 if ($frag)
806 0 0 unless $raf->Seek(4 - $frag, 1)
810 0 0 if $frag
811 0 0 unless $raf->Seek($n, 1)
835 0 0 unless ($raf)
839 0 0 if $start
840 0 0 unless defined $dirLen
843 0 0 unless ($raf->Read($buff, $pos) == $pos and $buff =~ /^Adobe Photoshop Document Data (Block|V0002)\0/)
853 0 0 unless $raf->Read($buff, 8) == 8
855 0 0 $buff =~ /^(8BIM|8B64)/ ? :
0 0 if $pos == 36
856 0 0 if &GetByteOrder() eq "II"
858 0 0 unless $sig eq "8BIM" or $sig eq "8B64"
860 0 0 if ($psb and $tag =~ /^(LMsk|Lr16|Lr32|Layr|Mt16|Mt32|Mtrn|Alph|FMsk|lnk2|FEid|FXid|PxSD)$/) { }
861 0 0 if $pos + 16 > $dirLen
862 0 0 unless $raf->Read($buff, 8) == 8
866 0 0 unless $raf->Read($buff, 4) == 4
870 0 0 if $pos + $n > $dirLen
873 0 0 if ($tagInfo or $verbose) { }
874 0 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
878 0 0 unless $raf->Seek($fpos, 0)
883 0 0 unless $raf->Read($buff, $n) == $n
885 0 0 unless $raf->Seek($pad, 1)
888 0 0 unless $raf->Seek($n + $pad, 1)
892 0 0 if $err
911 5 88 if ($Image::ExifTool::MWG::strict || $et->Options('Validate') and $et->{'FILE_TYPE'} =~ /^(JPEG|TIFF|PSD)$/)
915 0 5 unless ($path =~ /^(JPEG-APP13-Photoshop|TIFF-IFD0-Photoshop|PSD)$/)
916 0 0 if ($Image::ExifTool::MWG::strict) { }
924 0 93 if ($et->{'FILE_TYPE'} eq "JPEG" and $dirInfo->{'Parent'} ne "APP13")
928 0 93 if $verbose
939 1182 0 if ($type eq '8BIM') { }
0 0 elsif ($type =~ /^(PHUT|DCSR|AgHg|MeSa)$/) { }
954 1182 0 unless $nameLen & 1
955 0 1182 if ($pos + 4 > $dirEnd)
961 0 1182 if ($size + $pos > $dirEnd)
966 0 1182 if ($nameLen) { }
974 0 0 if ($tagInfo and defined $tagInfo->{'SetResourceName'} and $tagInfo->{'SetResourceName'} eq 1 and not $name =~ m[/#])
989 388 794 if $size & 1
993 32 28 if ($et->{'VALUE'}{'IPTCDigest'} and $et->{'VALUE'}{'CurrentIPTCDigest'} and $et->{'VALUE'}{'IPTCDigest'} ne $et->{'VALUE'}{'CurrentIPTCDigest'})
1013 0 5 unless $raf->Read($data, 30) == 30
1014 0 5 unless $data =~ /^8BPS\0([\x01\x02])/
1016 5 0 $1 eq "\cA" ? :
1023 1 4 if ($outfile) { }
1024 0 1 unless &Write($outfile, $data)
1025 0 1 unless $raf->Read($data, $len) == $len
1026 0 1 unless &Write($outfile, $data)
1034 0 4 unless $raf->Seek($len, 1)
1037 0 5 unless $raf->Read($data, 4) == 4
1039 0 5 unless $raf->Read($data, $len) == $len
1043 1 4 if ($outfile) { }
0 4 elsif ($err) { }
1046 1 0 if ($data) { }
1048 0 1 unless &Write($outfile, $len, $data)
1051 1 0 if ($trailInfo)
1055 1 0 if ($et->ProcessTrailers($trailInfo)) { }
1057 1 0 if ($copyBytes >= 0) { }
1060 0 1 $copyBytes > 65536 ? :
1061 0 1 unless $raf->Read($data, $n) == $n
1062 0 1 unless &Write($outfile, $data)
1066 0 1 unless $et->WriteTrailerBuffer($trailInfo, $outfile)
1075 0 1 unless ($trailInfo)
1078 0 0 unless &Write($outfile, $data)
1084 0 1 if $err
1095 4 0 if (&ProcessLayersAndMask($et, \%dirInfo, $tagTablePtr) and $raf->Read($data, 2) == 2)
1109 4 0 if $trailInfo