Branch Coverage

blib/lib/Image/ExifTool/QuickTime.pm
Criterion Covered Total %
branch 338 724 46.6


line true false branch
8146 0 22 if ($Image::ExifTool::QuickTime::AUTOLOAD eq 'Image::ExifTool::QuickTime::Process_mebx') { }
8165 1 0 if abs $cos < "1e-12"
8166 0 1 if abs $sin < "1e-12"
8180 0 5 if $a[0] == 0 and $a[1] == 0
8183 2 3 if $angle < 0
8198 6 5 $i ? :
8200 1 10 unless $value->{$tag}
8201 6 4 unless $value->{$tag} eq "vide"
8205 1 4 unless $track
8208 8 4 $i ? :
8210 0 12 unless $value->{$tag}
8211 8 4 unless $et->GetGroup($tag, 1) eq $track
8228 0 2 unless $a[6] == 0 and $a[7] == 0
8231 1 1 unless $w and $h
8235 0 1 unless defined $angle
8236 0 1 if ($angle == 90) { }
0 1 elsif ($angle == 180) { }
1 0 elsif ($angle == 270) { }
8260 0 21 unless $num and $dur and $et->{'MediaTS'}
8269 34 44 unless $val
8270 44 0 $val & 4293918720 ? :
8281 0 0 if ($val =~ /^([-+]\d{1,2}(?:\.\d*)?)([-+]\d{1,3}(?:\.\d*)?)([-+]\d+(?:\.\d*)?)?/) { }
0 0 elsif ($val =~ /^([-+])(\d{2})(\d{2}(?:\.\d*)?)([-+])(\d{3})(\d{2}(?:\.\d*)?)([-+]\d+(?:\.\d*)?)?/) { }
0 0 elsif ($val =~ /^([-+])(\d{2})(\d{2})(\d{2}(?:\.\d*)?)([-+])(\d{3})(\d{2})(\d{2}(?:\.\d*)?)([-+]\d+(?:\.\d*)?)?/) { }
8284 0 0 if $3
8288 0 0 if $1 eq "-"
8290 0 0 if $4 eq "-"
8292 0 0 if $7
8296 0 0 if $1 eq "-"
8298 0 0 if $5 eq "-"
8300 0 0 if $9
8313 0 0 if $size < 9
8318 0 0 if $pos + 9 > $size
8321 0 0 if $pos + 9 + $len > $size
8336 0 0 unless $val =~ /^(\S+) (.*)/
8343 0 0 if ($ss >= 60)
8345 0 0 if ++$m >= 60
8361 0 0 if (defined $v[2])
8362 0 0 $v[2] < 0 ? :
8374 10 0 if ($lang)
8378 10 0 if ($lang =~ /^[a-z]+$/) { }
8380 0 10 if $lang eq 'und' || $lang eq 'eng' and not $noDef
8396 0 6 if $ctry and $ctry <= 255
8397 0 6 if $lang and $lang <= 255
8400 1 5 if ($ctry)
8403 0 1 if $ctry eq "ZZ"
8404 1 0 if ($ctry and $ctry =~ /^[A-Z]{2}$/)
8405 0 1 unless $lang
8420 1 0 if ($langInfo)
8421 1 0 unless $et->{'QTLang'}
8437 0 78 if $pos + $n > $len
8438 0 78 if ($n == 0) { }
78 0 elsif ($n == 4) { }
0 0 elsif ($n == 8) { }
8460 25 215 if ord $ch == 0
8476 0 0 if ($n and $_[1])
8477 0 0 if ($n > 2 and $_[1] & 1) { }
0 0 elsif ($_[1] & 2) { }
8526 3 3 $et->{'IsWriting'} ? :
8529 0 6 if $len < 8
8536 6 0 if ($ver < 2) { }
8540 0 0 if $len < 10
8545 20 0 if ($ver < 2) { }
8546 0 20 if $pos + 2 > $len
8550 0 0 if $pos + 4 > $len
8554 0 20 if ($ver == 1 or $ver == 2)
8555 0 0 if $pos + 2 > $len
8559 0 20 if $pos + 2 > $len
8563 0 20 if $pos + 2 > $len
8568 0 20 if ($ver == 1 or $ver == 2)
8573 0 20 unless defined $extent_length
8577 0 0 defined $items->{$id}{'ConstructionMethod'} ? :
0 20 if $verbose
8594 0 8 if ($et->{'ItemRefVersion'}) { }
8595 0 0 if length $val < 10
8598 0 8 if length $val < 6
8601 0 8 if ($count > @to) { }
0 8 elsif ($count < @to) { }
8603 0 0 $et->{'IsWriting'} ? :
8622 9 11 $et->{'IsWriting'} ? :
8625 0 20 if $len < 4
8628 0 20 if $pos + 4 > $len
8629 0 20 if ($ver == 0 or $ver == 1) { }
8637 20 0 if ($ver == 2) { }
0 0 elsif ($ver == 3) { }
8644 0 20 if $pos + 6 > $len
8650 5 15 if ($type eq 'mime') { }
0 15 elsif ($type eq 'uri ') { }
8659 0 20 if $verbose > 1
8673 3 3 $et->{'IsWriting'} ? :
8676 0 6 if $len < 8
8682 12 0 if ($ver == 0) { }
8683 0 12 if $pos + 3 > $len
8687 0 0 if $pos + 5 > $len
8693 0 12 if ($flg & 1) { }
8694 0 0 if $pos + $n * 2 > $len
8698 0 0 $tmp & 32768 ? :
8702 0 12 if $pos + $n > $len
8706 12 12 $tmp & 128 ? :
8712 0 12 if $verbose > 1
8729 3 42 if ($items and $raf)
8738 0 11 if ($verbose)
8741 0 0 if ($item->{'Extents'} and @{$item->{'Extents'};})
8749 0 11 if $item->{'ContentEncoding'}
8750 0 11 if $item->{'ProtectionIndex'}
8751 0 11 if $item->{'ConstructionMethod'}
8752 0 11 if $warn and $name
8753 0 11 if $item->{'DataReferenceIndex'}
8754 0 11 unless ($item->{'Extents'} and @{$item->{'Extents'};} or $warn)
8756 0 0 if $name
8758 0 11 if ($warn)
8759 0 0 if $verbose > 2
8763 0 11 if ($verbose > 2)
8768 0 0 $verbose > 3 ? :
8772 0 0 if ($more > 0 and $n)
8773 0 0 if $more > $n
8774 0 0 if defined $buff
8775 0 0 unless $raf->Seek($extent->[1] + $base, 0)
8776 0 0 unless $raf->Read($buff, $more)
8780 0 0 if (defined $buff)
8781 0 0 if length $val
8784 0 0 if $snip
8788 0 0 if ($type eq "av01" and $et->{'ImageDataMD5'})
8792 0 0 unless $raf->Seek($extent->[1] + $base, 0)
8795 0 0 if $tot
8797 6 5 unless $name
8802 0 5 if defined $buff
8803 0 5 unless $raf->Seek($extent->[1] + $base, 0)
8804 1 4 unless $raf->Read($buff, $extent->[2])
8806 0 5 unless defined $buff
8807 0 5 if length $val
8808 1 4 unless length $buff
8811 2 2 if ($name eq 'EXIF' and length $buff >= 4) { }
0 2 elsif ($name eq 'PreviewImage') { }
8812 0 2 if ($buff =~ /^(MM\0\x2a|II\x2a\0)/) { }
0 2 elsif ($buff =~ /^Exif\0\0/) { }
8823 0 2 if ($start > length $buff)
8827 0 2 if ($et->{'HTML_DUMP'})
8829 0 0 if $n
8838 0 0 if ($buff =~ /^.{556}\xff\xc0\0\x11.(.{4})/s)
8841 0 0 if ($w == 160 or $h == 160) { }
0 0 elsif ($w == 1920 or $h == 1920) { }
8862 0 4 if (defined $primary and $item->{'RefersTo'} and not $item->{'RefersTo'}{$primary})
8876 3 42 if ($et->{'ItemPropertyContainer'})
8904 0 12 if ($flags == 21 or $flags == 22) { }
0 12 elsif ($flags == 23) { }
0 12 elsif ($flags == 24) { }
0 12 elsif ($flags == 0) { }
8906 0 0 $flags == 21 ? :
0 0 if $format
8927 0 0 unless $dirLen >= 2
8929 0 0 if $verbose
8933 0 0 if $pos + 10 > $dirLen
8935 0 0 if $size < 10 or $size + $pos > $dirLen
8941 0 0 if ($tagInfo)
8945 0 0 if ($lang)
8947 0 0 if $langInfo
8949 0 0 if $verbose
8956 0 0 if $enc == 1
8957 0 0 if ($enc == 0 and $tagInfo->{'Unknown'}) { }
8980 0 38 if $pos + 8 > $dirLen
8986 0 38 if $pos + 8 > $dirLen
8988 0 38 if $pos + $size > $dirLen
8994 0 0 if ($err and $et->{'HandlerType'})
9020 2110 94 if $tag =~ /[^\w ]/
9022 16 78 if ($size + $try == $end)
9028 58 20 if ($size < 8 or $size + $try > $end - 8) { }
9038 16 22 if ($childPos)
9061 0 0 if $tag eq "\0\0\0\0"
9064 0 0 unless ($tagInfo)
9065 0 0 unless $unknown
9074 0 0 unless $tagInfo->{'Format'}
9114 0 9 if ($et->Options("Verbose"))
9125 0 22 if $len < 8 or $pos + $len > $dirLen
9131 22 0 if $ns eq "mdta"
9132 0 22 unless $tag
9136 22 0 if $tagInfo = $et->GetTagInfo($tagTablePtr, $tag)
9138 0 0 if $tagInfo = $et->GetTagInfo($itemList, $tag)
9139 0 0 if $tagInfo = $et->GetTagInfo($userData, $tag)
9141 0 0 if ($tag =~ /^\w{3}\xa9$/)
9143 0 0 if $tagInfo = $et->GetTagInfo($itemList, $tag)
9147 0 0 if ($tag eq $full)
9154 22 0 if ($tagInfo) { }
0 0 elsif ($tag =~ /^[-\w. ]+$/ or $tag =~ /\w{4}/) { }
9165 0 22 defined $tagInfo->{'Writable'} ? :
9167 10 12 $groups ? :
9177 0 0 if length $name < 2
9183 18 4 if (ref $itemList->{$id} eq "HASH")
9186 0 18 if ($oldInfo->{'OtherLang'})
9191 22 0 if ($newInfo)
9194 22 0 unless $msg
9195 0 22 if $out
9211 0 0 if $et->{'OPTIONS'}{'ExtractEmbedded'}
9235 20 363 unless defined $et->{'HandlerType'}
9237 20 363 unless (defined $et->{'KeysCount'})
9242 363 20 unless ($raf)
9244 363 0 if $dirInfo->{'DirLen'}
9247 94 289 if ($dirInfo->{'DirStart'})
9248 0 94 unless $raf->Seek($dirInfo->{'DirStart'}, 1)
9252 0 383 unless $raf->Read($buff, 8) == 8
9254 363 20 if ($tagTablePtr) { }
9260 363 20 if ($dataPt) { }
9261 0 363 if $verbose
9264 0 20 unless $tagTablePtr->{$tag}
9266 11 9 if ($tag eq 'ftyp' and $size >= 12) { }
9268 11 0 if ($raf->Read($buff, $size - 8) == $size - 8)
9273 11 0 if ($ftypLookup{$type} and $ftypLookup{$type} =~ /\(\.(\w+)/) { }
0 0 elsif ($buff =~ /^.{8}(.{4})+(mp41|mp42|avc1)/s) { }
0 0 elsif ($buff =~ /^.{8}(.{4})+(f4v )/s) { }
0 0 elsif ($buff =~ /^.{8}(.{4})+(qt )/s) { }
9284 0 11 unless $fileType
9287 4 7 if $fileType eq "CRX"
9293 20 0 unless $fileType and $fileType eq "HEIC"
9296 0 383 if $fast
9300 134 249 if ($ee or $md5)
9304 22 361 if ($tagTablePtr->{'VARS'})
9310 0 1253 if defined $atomCount and --$atomCount < 0
9311 4 1249 if ($size < 8) { }
9312 0 4 if ($size == 0)
9313 0 0 if ($dataPt) { }
9323 0 0 if ($$tagTablePtr{"$tag-size"})
9325 0 0 unless ($fast)
9329 0 0 if $$tagTablePtr{"$tag-offset"}
9334 0 4 unless $size == 1
9336 0 4 unless $raf->Read($buff, 8) == 8
9339 0 4 if ($hi or $lo > 2147483647)
9340 0 0 if ($hi > 2147483647) { }
0 0 elsif (not $et->Options('LargeFileSupport')) { }
9349 0 4 if $size < 0
9353 0 1253 if ($validate)
9354 0 0 unless $et->{'ValidatePath'}
9356 0 0 if $et->{'SET_GROUP1'}
9357 0 0 if ($et->{'ValidatePath'}{$path} and not $dupTagOK{$tag} and not $dupDirOK{$dirID})
9359 0 0 $i < 255 ? :
9361 0 0 if $path eq "MOV-moov"
9365 0 77 if ($isUserData and $et->{'SET_GROUP1'})
9369 0 0 if (not $tagTablePtr->{$tag} and $tagInfo)
9372 0 0 unless $tagInfo->{$_}
9381 104 1149 if ($eeBox{$handlerType} and $eeBox{$handlerType}{$tag}) { }
0 1149 elsif ($ee and $ee > 1 and $eeBox2{$handlerType} and $eeBox2{$handlerType}{$tag}) { }
0 1149 elsif ($md5 and $md5Box{$handlerType} and $md5Box{$handlerType}{$tag}) { }
9382 68 36 if ($ee or $md5) { }
0 72 elsif ($handlerType ne 'vide' and not $et->{'OPTIONS'}{'Validate'}) { }
9384 68 0 if ($tag ne "gps " or $eeBox{$handlerType}{$tag} eq $dirID)
9400 68 1185 if $eeTag
9403 160 1093 unless ($tagInfo)
9405 22 138 if ($tagTablePtr->{$id})
9411 0 88 if (not defined $tagInfo and $et->{'OPTIONS'}{'Unknown'} || $verbose || $tag =~ /^\xa9/)
9415 0 13 if ($name =~ /^xa9(.*)/) { }
9430 23 1230 if ($$tagTablePtr{"$tag-size"})
9432 23 0 if $$tagTablePtr{"$tag-offset"}
9435 0 0 if $fast > 1 and $tag eq 'mdat' || $tag eq 'idat'
9437 0 1253 if ($size > 33554432)
9439 0 0 if ($buff =~ /^(gpsa|gps0|gsen|gsea)...\0/s)
9441 0 0 if ($et->Options('ExtractEmbedded')) { }
9442 0 0 unless $raf->Seek(-8, 1)
9451 0 0 if ($tagInfo and not $tagInfo->{'Unknown'} and not $eeTag)
9453 0 0 if ($size > 134217728) { }
9456 0 0 unless $et->Warn("Skipping '${t}' atom > 32 MB", 2)
9460 1165 88 if (defined $tagInfo and not $ignore) { }
9462 12 1153 if ($et->{'IsItemProperty'})
9467 14 22 unless $items->{$id}{'Association'}
9470 29 12 unless $prop == $index
9471 6 6 if ($id == $primary or not $dontInherit{$tag} and !$item->{'RefersTo'} || $item->{'RefersTo'}{$primary}) { }
3 3 elsif ($item->{'DocNum'}) { }
3 0 elsif (not defined $lowest or $lowest > $id) { }
9482 3 0 if not defined $docNum or $docNum > $item->{'DocNum'}
9489 3 9 if (not defined $docNum and defined $lowest)
9499 0 1165 if ($missing)
9505 37 1128 unless $tagInfo
9507 0 1165 if ($verbose and not $hasData)
9509 0 0 if ($tagInfo and $tagInfo->{'Format'})
9518 0 0 $tagInfo ? :
9521 0 0 if ($dirID eq "iref")
9523 0 0 if ($et->{'ItemRefVersion'}) { }
9524 0 0 if length $val >= 10
9526 0 0 if length $val >= 6
9528 0 0 unless defined $id
9529 0 0 if $count != @to
9532 0 0 unless $to[$i - 1] =~ /(\d+)$/ and $to[$i] == $1 + 1
9540 68 1097 if ($eeTag)
9543 28 40 if $tagInfo and $tagInfo->{'Unknown'} and not $unkOpt
9547 9 1128 if ($tagInfo and $tagInfo->{'Triplet'})
9548 3 6 if ($tag eq 'data' and $triplet{'mean'} and $triplet{'name'}) { }
9551 0 3 unless $triplet{'mean'} eq "com.apple.iTunes"
9553 0 3 unless ($tagInfo)
9566 3 0 if length $val >= 8
9567 3 0 unless ($tagInfo->{'Format'} or $tagInfo->{'SubDirectory'})
9569 0 3 if ($val =~ /[^\x20-\x7e]/)
9575 0 3 if $verbose
9577 6 0 if length $val > 4
9581 1131 34 if ($tagInfo)
9583 674 457 if ($subdir) { }
157 300 elsif ($hasData) { }
49 251 elsif ($tag =~ /^\xa9/ or $tagInfo->{'IText'}) { }
9586 0 674 if ($subdir->{'Base'})
9603 0 674 if $tagInfo->{'BlockExtract'}
9604 6 668 if ($subdir->{'ByteOrder'} and $subdir->{'ByteOrder'} =~ /^Little/)
9608 38 636 if ($tagInfo->{'SubDirectory'} and $tagInfo->{'SubDirectory'}{'TagTable'} and $tagInfo->{'SubDirectory'}{'TagTable'} eq "Image::ExifTool::QuickTime::Track")
9611 17 21 unless $track
9617 18 602 unless $proc or $subTable->{'PROCESS_PROC'}
9618 674 0 if ($size > $start)
9620 3 671 if ($tag eq 'ipco' and not $et->{'IsItemProperty'}) { }
9627 38 636 if ($tag eq 'stbl') { }
38 598 elsif ($tag eq 'minf') { }
9629 16 22 if $ee or $md5
9640 157 161 if $pos + 16 > $size
9642 0 161 if $pos + $len > $size or not $len
9645 161 0 if ($type eq "data" and $len >= 16)
9654 116 45 if ($Image::ExifTool::QuickTime::stringEncoding{$flags}) { }
9658 116 0 unless $tagInfo->{'Binary'}
9660 12 33 if (not $format) { }
15 18 elsif ($format =~ /^int\d+([us])$/) { }
9665 15 0 if defined $fmt
9667 33 12 if ($format) { }
12 0 elsif (not $tagInfo->{'ValueConv'}) { }
9676 1 160 if ($ctry or $lang)
9678 1 0 if ($langCode)
9682 1 0 if ($langInfo)
9683 1 0 unless $tagInfo->{'OtherLang'}
9688 160 1 unless $langInfo
9689 161 0 $qtFlags{$flags} ? :
9690 0 0 ref $value ? :
0 161 if $verbose
9702 22 139 if ($isKey)
9706 161 0 if defined $value
9707 22 139 if $isKey
9713 0 49 if ($tagInfo->{'Format'})
9719 4 94 if ($tagInfo->{'IText'} and $tagInfo->{'IText'} >= 6) { }
9720 2 2 if $pos + $tagInfo->{'IText'} > $size
9726 47 47 if $pos + 4 > $size
9733 0 47 if ($pos + $len > $size)
9735 0 0 if $pos + $len > $size or $len < 0
9739 0 49 if not $len and $pos
9742 49 0 if ($lang < 1024 || $lang == 32767 and not $str =~ /^\xfe\xff/) { }
9745 0 49 if ($lang) { }
9746 0 0 if ($lang == 32767) { }
9758 0 49 if &Image::ExifTool::IsUTF8(\$str) > 0
9762 49 0 unless $enc
9767 0 0 $str =~ s/^\xfe\xff// ? :
9769 48 1 unless ($tagInfo->{'NoDecode'})
9773 1 48 if ($tagInfo->{'IText'} and $tagInfo->{'IText'} > 6)
9778 0 49 if $lang
9784 68 183 if ($format)
9788 0 251 if ($tagInfo->{'SetBase'})
9793 0 251 if defined $oldBase
9795 20 0 if (defined $key and !$format || $format =~ /^string/ and not $tagInfo->{'Unknown'} and not $tagInfo->{'ValueConv'} and not $tagInfo->{'Binary'} and defined $et->{'VALUE'}{$key} and not ref $val)
9800 0 16 if (not ref $$vp and length $$vp <= 65536 and $$vp =~ /[\x80-\xff]/)
9803 0 0 &Image::ExifTool::IsUTF8($vp) > 0 ? :
9810 0 88 if $verbose
9814 0 82 if ($size and !$raf->Seek($size - 1, 1) || $raf->Read($buff, 1) != 1)
9821 363 890 if $dirEnd and $dataPos >= $dirEnd
9822 20 870 unless $raf->Read($buff, 8) == 8
9824 9 861 if defined $index
9827 0 0 if ($topLevel and $et->{'FileType'} and $et->{'FileType'} eq "MP4" and $et->{'save_ftyp'} and $et->{'HasHandler'} and $et->{'save_ftyp'} =~ /^(iso|dash)/ and $et->{'HasHandler'}{'soun'} and not $et->{'HasHandler'}{'vide'})
9835 1 19 if ($doDefaultLang and $et->{'QTLang'})
9837 0 1 unless defined $et->{'VALUE'}{$tag}
9838 0 1 unless my $langInfo = $et->{'TAG_INFO'}{$tag}
9839 0 1 unless my $tagInfo = $langInfo->{'SrcTagInfo'}
9846 1 0 if $et->GetGroup($key, 0) eq "QuickTime"
9853 45 338 if $topLevel or $dirID eq "meta"
9855 4 379 if $ee and $topLevel