Branch Coverage

blib/lib/Image/ExifTool/Photoshop.pm
Criterion Covered Total %
branch 58 234 24.7


line true false branch
733 0 0 if $i + $n >= $len
734 0 0 if $i
754 0 4 unless $fileType eq "PSD" or $fileType eq "PSB"
757 0 4 $fileType eq 'PSB' ? :
761 0 4 unless $raf->Read($data, $n) == $n
762 0 4 $psb ? :
763 0 4 if $tot == 0
766 0 4 $psb ? :
769 4 0 if ($len == 0 and $num == 0)
770 0 4 unless $raf->Read($data, 10) == 10
771 0 4 if ($data =~ /^..8BIMLr16/s) { }
0 4 elsif ($data =~ /^..8BIMMt16/s) { }
772 0 0 unless $raf->Read($data, $psiz + 2) == $psiz + 2
773 0 0 $psb ? :
775 0 0 unless $raf->Read($data, $psiz) == $psiz
776 0 0 unless $raf->Read($data, 8) == 8
777 0 0 if ($data eq '8BIMLr16') { }
778 0 0 unless $raf->Read($data, $psiz + 2) == $psiz + 2
779 0 0 $psb ? :
781 0 0 unless $raf->Seek(-18 - $psiz, 1)
784 0 4 unless $raf->Seek(-10, 1)
788 0 4 unless $raf->Seek(-2, 1)
797 4 0 $raf->Seek($end, 0) ? :
834 0 4 if $dirLen < 2
835 0 4 unless $raf->Read($buff, 2) == 2
837 0 4 if $num < 0
844 0 4 $psb ? :
847 0 0 if $pos + 18 > $dirLen
848 0 0 unless $raf->Read($buff, 18) == 18
854 0 0 unless $raf->Seek($n, 1)
856 0 0 if $pos + 20 > $dirLen
857 0 0 unless $raf->Read($buff, 20) == 20
860 0 0 unless $sig =~ /^(8BIM|MIB8)$/
867 0 0 if $pos + 4 > $dirLen
868 0 0 unless $raf->Seek($n, 1) and $raf->Read($buff, 4) == 4
871 0 0 if $pos + 1 > $dirLen
872 0 0 unless $raf->Seek($n, 1) and $raf->Read($buff, 1) == 1
874 0 0 if $pos + 1 + $n > $dirLen
875 0 0 unless $raf->Read($buff, $n) == $n
879 0 0 if $frag
884 0 0 unless $raf->Read($buff, 12) == 12
886 0 0 if &GetByteOrder() eq "II"
888 0 0 unless $sig eq "8BIM" or $sig eq "8B64"
893 0 0 if ($psb and $tag =~ /^(LMsk|Lr16|Lr32|Layr|Mt16|Mt32|Mtrn|Alph|FMsk|lnk2|FEid|FXid|PxSD)$/) { }
894 0 0 if $pos + 16 > $nxt
895 0 0 unless $raf->Read($buf2, 4) == 4
903 0 0 if $pos + $n > $nxt
905 0 0 if ($tagTablePtr->{$tag} or $verbose) { }
907 0 0 unless defined $count{$tag}
908 0 0 unless $raf->Read($buff, $n) == $n
911 0 0 $tag eq 'lsct' ? :
916 0 0 if ($frag)
917 0 0 unless $raf->Seek(4 - $frag, 1)
921 0 0 if $frag
922 0 0 unless $raf->Seek($n, 1)
931 0 0 $_ eq 'lsct' ? :
953 0 0 unless ($raf)
957 0 0 if $start
958 0 0 unless defined $dirLen
961 0 0 unless ($raf->Read($buff, $pos) == $pos and $buff =~ /^Adobe Photoshop Document Data (Block|V0002)\0/)
971 0 0 unless $raf->Read($buff, 8) == 8
973 0 0 $buff =~ /^(8BIM|8B64)/ ? :
0 0 if $pos == 36
974 0 0 if &GetByteOrder() eq "II"
976 0 0 unless $sig eq "8BIM" or $sig eq "8B64"
978 0 0 if ($psb and $tag =~ /^(LMsk|Lr16|Lr32|Layr|Mt16|Mt32|Mtrn|Alph|FMsk|lnk2|FEid|FXid|PxSD)$/) { }
979 0 0 if $pos + 16 > $dirLen
980 0 0 unless $raf->Read($buff, 8) == 8
984 0 0 unless $raf->Read($buff, 4) == 4
988 0 0 if $pos + $n > $dirLen
991 0 0 if ($tagInfo or $verbose) { }
992 0 0 if ($tagInfo and $tagInfo->{'SubDirectory'}) { }
996 0 0 unless $raf->Seek($fpos, 0)
1001 0 0 unless $raf->Read($buff, $n) == $n
1003 0 0 unless $raf->Seek($pad, 1)
1006 0 0 unless $raf->Seek($n + $pad, 1)
1010 0 0 if $err
1029 5 91 if ($Image::ExifTool::MWG::strict || $et->Options('Validate') and $et->{'FILE_TYPE'} =~ /^(JPEG|TIFF|PSD)$/)
1033 0 5 unless ($path =~ /^(JPEG-APP13-Photoshop|TIFF-IFD0-Photoshop|PSD)$/)
1034 0 0 if ($Image::ExifTool::MWG::strict) { }
1042 0 96 if ($et->{'FILE_TYPE'} eq "JPEG" and $dirInfo->{'Parent'} ne "APP13")
1046 0 96 if $verbose
1057 1185 0 if ($type eq '8BIM') { }
0 0 elsif ($type =~ /^(PHUT|DCSR|AgHg|MeSa)$/) { }
1072 1185 0 unless $nameLen & 1
1073 0 1185 if ($pos + 4 > $dirEnd)
1079 0 1185 if ($size + $pos > $dirEnd)
1084 0 1185 if ($nameLen) { }
1092 0 0 if ($tagInfo and defined $tagInfo->{'SetResourceName'} and $tagInfo->{'SetResourceName'} eq 1 and not $name =~ m[/#])
1107 389 796 if $size & 1
1111 32 28 if ($et->{'VALUE'}{'IPTCDigest'} and $et->{'VALUE'}{'CurrentIPTCDigest'} and $et->{'VALUE'}{'IPTCDigest'} ne $et->{'VALUE'}{'CurrentIPTCDigest'})
1131 0 5 unless $raf->Read($data, 30) == 30
1132 0 5 unless $data =~ /^8BPS\0([\x01\x02])/
1134 5 0 $1 eq "\cA" ? :
1141 1 4 if ($outfile) { }
1142 0 1 unless &Write($outfile, $data)
1143 0 1 unless $raf->Read($data, $len) == $len
1144 0 1 unless &Write($outfile, $data)
1152 0 4 unless $raf->Seek($len, 1)
1155 0 5 unless $raf->Read($data, 4) == 4
1157 0 5 unless $raf->Read($data, $len) == $len
1161 1 4 if ($outfile) { }
0 4 elsif ($err) { }
1164 1 0 if ($data) { }
1166 0 1 unless &Write($outfile, $len, $data)
1169 1 0 if ($trailInfo)
1173 1 0 if ($et->ProcessTrailers($trailInfo)) { }
1175 1 0 if ($copyBytes >= 0) { }
1178 0 1 $copyBytes > 65536 ? :
1179 0 1 unless $raf->Read($data, $n) == $n
1180 0 1 unless &Write($outfile, $data)
1184 0 1 unless $et->WriteTrailerBuffer($trailInfo, $outfile)
1193 0 1 unless ($trailInfo)
1196 0 0 unless &Write($outfile, $data)
1202 0 1 if $err
1213 4 0 if (&ProcessLayersAndMask($et, \%dirInfo, $tagTablePtr) and $raf->Read($data, 2) == 2)
1227 4 0 if $trailInfo