Branch Coverage

blib/lib/Image/ExifTool/WriteCanonRaw.pl
Criterion Covered Total %
branch 138 216 63.8


line true false branch
82 0 57 unless $formName
85 0 57 if $tagInfo and $tagInfo->{'Name'} eq "UserComment"
90 19 38 if ($count and $size != $count * $fsiz) { }
91 0 19 if ($size < $count * $fsiz)
104 35 22 if ($size > 4) { }
109 0 35 if $size & 1
114 8 14 if $size < 4
132 0 6 unless $numEntries
139 22 35 unless $makerInfo->{'FixupTags'}{$tagID}
160 6 0 if (defined $rotation and defined $mapRotation{$rotation})
175 5 145 if ($tagName eq 'JpgFromRaw' or $tagName eq 'ThumbnailImage') { }
176 1 4 unless ($$valPtr =~ /^\xff\xd8/ or $et->Options("IgnoreMinorErrors"))
182 130 15 unless ($format)
186 145 0 if $format
199 0 3 unless my $dataPt = $dirInfo->{'DataPt'}
200 0 3 unless my $outfile = $dirInfo->{'OutFile'}
201 0 3 unless $dirInfo->{'RAF'}
204 0 3 unless ($$dataPt =~ /^.{8}CR\x02\0/s)
206 0 0 if ($$dataPt =~ /^.{8}CR/s) { }
0 0 elsif ($$dataPt =~ /^.{8}\xba\xb0\xac\xbb/s) { }
214 0 0 if $et->Error($msg, $minor)
220 0 3 unless defined $newData
221 0 3 unless ($dirInfo->{'LastIFD'})
226 3 0 if (length $newData)
233 0 3 unless &Write($outfile, $header, $newData)
237 3 0 if (ref $dirInfo->{'ImageData'})
238 0 3 unless $et->CopyImageData($dirInfo->{'ImageData'}, $outfile)
259 174 49 unless $et
262 0 49 unless my $raf = $dirInfo->{'RAF'}
263 0 49 unless my $outfile = $dirInfo->{'OutFile'}
264 0 49 unless my $outPos = $dirInfo->{'OutPos'}
271 0 49 unless $raf->Seek($blockStart + $blockSize - 4, 0)
272 0 49 unless $raf->Read($buff, 4) == 4
275 7 42 unless $et->{'ProcessedCanonRaw'}
276 0 49 if ($et->{'ProcessedCanonRaw'}{$dirOffset})
281 0 49 unless $raf->Seek($dirOffset, 0)
282 0 49 unless $raf->Read($buff, 2) == 2
285 0 49 unless $raf->Read($buff, 10 * $entries) == 10 * $entries
294 7 42 if ($dirInfo->{'Nesting'} == 0)
298 1 14 if defined $permanent and not $permanent
305 287 49 if ($index < $entries)
314 1 1 if (@addTags and !defined($tag) || $tag >= $addTags[0])
318 1 0 if (defined $newVal)
323 0 1 if length $newVal & 1
328 0 1 unless &Write($outfile, $newVal)
330 0 1 if $verbose > 1
336 49 287 unless defined $tag
337 0 287 if $tag & 32768
345 233 54 if ($tagInfo)
347 15 218 if $tagInfo->{'Format'}
350 97 190 if ($valueInDir) { }
354 72 25 if not defined $count and $format and $format ne "string" and not $subdir
357 42 148 if ($tagType == 40 or $tagType == 48) { }
360 42 0 if $tagInfo
361 0 42 unless $name
374 0 42 unless $result
381 0 148 unless $valuePtr + $size <= $blockSize
383 0 148 unless $raf->Seek($ptr, 0)
384 0 148 unless $raf->Read($value, $size) == $size
388 167 120 if ($format and not $count)
395 233 54 if ($tagInfo)
396 67 166 if ($subdir and $subdir->{'TagTable'}) { }
16 150 elsif ($newTags->{$tagID}) { }
399 0 67 unless $newTagTable
402 0 67 if $subdir->{'Start'}
415 0 67 if (defined $subdir->{'Validate'} and not eval $subdir->{'Validate'}) { }
419 61 6 if (defined $subdir and length $subdir)
420 0 61 if ($subdirStart) { }
429 1 15 if ($delTag{$tagID})
430 0 1 if $verbose > 1
435 15 0 if ($format) { }
441 14 1 if ($et->IsOverwriting($nvHash, $oldVal))
444 0 14 if $verbose > 1
446 14 0 if (defined $newVal and $format)
449 14 0 if (defined $newVal)
458 97 189 if ($valueInDir)
460 5 92 if ($len < 8) { }
0 92 elsif ($len > 8) { }
471 147 42 if (defined $value)
475 0 147 if ($diff)
476 0 0 if ($writable and $writable eq 'resize') { }
0 0 elsif ($diff > 0) { }
485 2 145 if $size & 1
488 0 147 unless &Write($outfile, $value)
498 0 49 unless &Write($outfile, $newDir)
521 0 7 unless $raf->Read($buff, 2) == 2
522 0 7 unless &SetByteOrder($buff)
523 0 7 unless $raf->Read($buff, 4) == 4
524 0 7 unless $raf->Read($sig, 8) == 8
525 0 7 unless $sig =~ /^HEAP(CCDR|JPGM)/
529 0 7 if ($et->{'DEL_GROUP'}{'MakerNotes'})
530 0 0 if ($type eq 'CCDR') { }
539 3 4 if ($et->{'FILE_TYPE'} eq "CRW")
544 0 7 unless $raf->Seek(0, 0)
545 0 7 unless $raf->Read($buff, $hlen) == $hlen
546 0 7 unless &Write($outfile, $buff)
548 0 7 unless $raf->Seek(0, 2)
549 0 7 unless my $filesize = $raf->Tell
569 4 3 unless my $trailInfo = &Image::ExifTool::IdentifyTrailer($raf)
573 0 3 unless $success = $et->ProcessTrailers($trailInfo)
576 1 2 if length $$trailPt < 4
579 7 0 if ($success) { }
582 1 2 if (not $trailPt and $et->{'ADD_DIRS'}{'CanonVRD'})
587 1 0 if (&Image::ExifTool::CanonVRD::ProcessCanonVRD($et, {"OutFile", \$outbuff}) > 0)
593 5 2 if ($trailPt)
597 1 4 $len & 1 ? :
598 0 5 unless &Write($outfile, $pad, substr($$trailPt, 0, $len - 4), $newDirStart)
600 0 7 $err ? :