Branch Coverage

blib/lib/Image/ExifTool/Jpeg2000.pm
Criterion Covered Total %
branch 155 290 53.4


line true false branch
716 95 19 if ($et->{'jumd_level'}) { }
728 19 95 if (@{$et->{'jumd_level'};} < 2)
747 0 114 if $dirInfo->{'DirLen'} < 17
753 114 0 if ($flags & 2)
755 0 114 unless $$dataPt =~ /\0/g
760 114 0 if ($len)
765 0 114 if length $name < 2
769 0 114 if ($flags & 4)
770 0 0 if $pos + 4 > $end
774 0 114 if ($flags & 8)
775 0 0 if $pos + 32 > $end
780 0 114 if ($more)
782 0 0 if ($more >= 8) { }
816 0 1 unless $tagInfo->{'List'} or $et->IsOverwriting($nvHash) > 0
817 0 1 if $nvHash->{'EditOnly'}
822 0 1 unless &Write($outfile, $boxhdr, $val)
830 2 11 if ($dirName eq "xml " or $dirName eq "Exif")
831 1 1 $dirName eq 'xml ' ? :
833 1 1 if ref $tagInfo eq "ARRAY"
836 1 1 if $dir eq "XMP"
842 2 0 if (defined $newdir and length $newdir)
844 1 1 $dirName eq 'Exif' ? :
846 0 2 unless &Write($outfile, $boxhdr, $pad, $newdir)
850 9 2 unless $uuid{$dirName}
853 8 2 unless $tagInfo->{'Name'} eq $dirName
864 2 0 if (defined $newdir and length $newdir)
866 0 2 unless &Write($outfile, $boxhdr, $newdir)
887 1 0 unless ($meth)
888 0 1 if ($icc) { }
1 0 elsif (defined $space) { }
0 0 elsif (defined $cdata) { }
898 1 0 if ($meth eq '1') { }
0 0 elsif ($meth eq '2' or $meth eq '3') { }
0 0 elsif ($meth eq '4') { }
899 0 1 unless defined $space
902 0 0 unless defined $icc
905 0 0 unless defined $cdata
910 0 1 unless &Write($outfile, $boxhdr, pack("CCC", $meth, $prec, $approx), $cdata)
935 3 141 if ($outfile) { }
936 1 2 unless ($raf)
942 1 2 if ($dirInfo->{'DirName'} and $dirInfo->{'DirName'} eq "JP2Header")
943 0 0 if defined $et->GetNewValue("ColorSpecMethod") or $et->GetNewValue("ICC_Profile") or defined $et->GetNewValue("ColorSpecPrecedence") or defined $et->GetNewValue("ColorSpace") or defined $et->GetNewValue("ColorSpecApproximation") or defined $et->GetNewValue("ColorSpecData")
950 0 141 if $verbose
957 40 431 if ($raf) { }
138 293 elsif ($pos >= $dirEnd - $hdrLen) { }
960 6 34 unless ($n == $hdrLen)
961 0 6 if $n
962 2 4 if $outfile
969 0 138 unless $pos == $dirEnd
975 1 326 if ($doColour and $boxID eq "colr")
976 1 0 if ($doColour == 1)
986 0 326 if ($boxLen == 1) { }
0 326 elsif ($boxLen == 0) { }
989 0 0 if ($raf)
991 0 0 if ($raf->Read($buf2, 8) == 8)
996 0 0 if $pos > $dirEnd - 8
998 0 0 if $hi
1002 0 0 if ($raf)
1003 0 0 if ($outfile) { }
0 0 elsif ($verbose) { }
1004 0 0 unless &CreateNewBoxes($et, $outfile)
1006 0 0 unless &Write($outfile, $$dataPt)
1008 0 0 unless &Write($outfile, $buff)
1020 0 326 if $boxLen < 0
1022 0 326 unless (defined $tagInfo or $verbose)
1024 0 0 if ($raf) { }
0 0 elsif ($outfile) { }
1025 0 0 if ($outfile) { }
1026 0 0 unless &Write($outfile, $$dataPt)
1027 0 0 unless $raf->Read($buff, $boxLen) == $boxLen
1028 0 0 unless &Write($outfile, $buff)
1030 0 0 unless $raf->Seek($boxLen, 1)
1033 0 0 unless &Write($outfile, substr($$dataPt, $pos - $hdrLen, $boxLen + $hdrLen))
1037 34 292 if ($raf) { }
0 292 elsif ($pos + $boxLen > $dirEnd) { }
1040 0 34 unless $raf->Read($buff, $boxLen) == $boxLen
1049 10 316 if (defined $tagInfo and not $tagInfo)
1051 4 6 $boxLen < 128 ? :
1055 9 317 if ($outfile and $tagInfo)
1056 0 9 if ($boxID eq 'uuid' and $et->{'DEL_GROUP'}{'*'}) { }
2 7 elsif ($tagInfo->{'Writable'}) { }
1062 0 2 if ($et->{'DEL_GROUP'}{'Jpeg2000'}) { }
1068 2 0 if ($isOverwriting) { }
0 0 elsif (not $tagInfo->{'List'}) { }
1079 57 114 if ($tagInfo and $et->{'JUMBFLabel'} and !$tagInfo->{'SubDirectory'} || $tagInfo->{'BlockExtract'})
1086 0 324 if ($verbose)
1094 0 0 unless $tagInfo
1096 319 5 if ($tagInfo->{'SubDirectory'}) { }
1 4 elsif ($tagInfo->{'Format'} and not $outfile) { }
1 3 elsif ($outfile) { }
1100 11 308 if (defined $subdir->{'Start'})
1104 0 11 if ($subdirLen < 0)
1124 6 313 if ($outfile) { }
1130 2 4 if ($uuid or $boxID eq 'Exif' or $boxID eq 'xml ' and $et->{'IsJXL'} or $boxID eq 'jp2h' and $et->{'EDIT_DIRS'}{'jp2h'}) { }
0 4 elsif (defined $uuid) { }
1134 0 2 if defined $newdir and not length $newdir
1139 4 2 unless defined $newdir
1142 2 4 if $prefixLen
1143 0 6 unless &Write($outfile, $boxhdr, $newdir)
1145 1 5 if ($doColour and $boxID eq "ihdr")
1147 1 0 $doColour == 2 ? :
1151 62 251 if $tagInfo->{'BlockExtract'}
1152 0 313 if defined $uuid and $uuid eq 0
1153 0 313 unless ($et->ProcessDirectory(\%subdirInfo, $subTable, $subdir->{'ProcessProc'}))
1154 0 0 if ($subTable eq $tagTablePtr)
1165 1 0 if (defined $val)
1168 0 1 if defined $rational and defined $key
1172 0 1 unless &Write($outfile, $boxhdr, substr($$dataPt, $valuePtr, $boxLen))
1175 0 144 if (defined $err)
1176 0 0 unless $err
1177 0 0 if ($outfile)
1178 0 0 unless $err eq 1
1179 0 0 $raf ? :
1183 1 143 if $outfile and not $raf
1202 572 52 if ($i) { }
1203 216 356 if $set
1205 14 38 if $set
1221 1 1 if (length $$dataPt < 14)
1228 0 2 if ($small) { }
1234 2 0 if ($ratio == 0) { }
1235 0 2 if ($small) { }
1262 0 7 unless $raf->Read($hdr, 12) == 12
1263 1 2 unless ($hdr eq "\0\0\0\fjP \r\n\207\n" or $hdr eq "\0\0\0\fjP\32\32\r\n\207\n" or $et->{'IsJXL'})
1267 0 1 unless $hdr =~ /^\xff\x4f\xff\x51\0/
1268 0 1 if ($outfile)
1273 1 0 unless ($Image::ExifTool::jpegMarker{'79'})
1280 2 4 if ($outfile) { }
1281 0 2 unless &Write($outfile, $hdr)
1282 1 1 if ($et->{'IsJXL'}) { }
1295 4 0 if ($raf->Read($buff, 12) == 12 and $buff =~ /^.{4}ftyp(.{4})/s)
1296 0 4 if $1 eq "jpx "
1297 0 4 if $1 eq "jpm "
1298 1 3 if $1 eq "jxl "
1300 4 0 if defined $buff
1324 0 3 unless $raf->Read($hdr, 12) == 12
1325 1 2 if ($hdr eq "\000\000\000\fJXL \r\n\207\n") { }
2 0 elsif ($hdr =~ /^\xff\x0a/) { }
1330 1 1 if ($outfile) { }
1331 1 0 if ($et->{'OPTIONS'}{'IgnoreMinorErrors'}) { }
1348 0 2 unless $raf->Seek(0, 0)
1352 1 0 if ($outfile and $success > 0 and $et->{'IsJXL'} == 2)
1354 0 1 unless $raf->Seek(0, 2)
1356 0 1 unless $raf->Seek(0, 0)
1358 0 1 unless &Write($outfile, &Set32u($size + 8), "jxlc")
1360 0 1 unless &Write($outfile, $buff)