Branch Coverage

blib/lib/Image/ExifTool/WriteRIFF.pl
Criterion Covered Total %
branch 77 166 46.3


line true false branch
50 0 3 unless $et
62 0 6 unless $raf->Read($buff, 12) == 12
63 0 6 unless $buff =~ /^(RIFF|RF64)....(.{4})/s
65 0 6 unless ($1 eq "RIFF" and $2 eq "WEBP")
74 3 3 if $pass
78 4 2 if $addDirs->{'EXIF'}
82 3 3 if ($pass) { }
86 0 3 if ($has{'VP8X'} and not $needsVP8X and $et->{'CHANGED'}) { }
0 3 elsif ($needsVP8X and not $has{'VP8X'}) { }
90 0 0 if (defined $imageWidth) { }
100 0 3 unless &Write($outfile, $buff)
102 0 3 if ($createVP8X)
105 0 0 if $has{'ANIM'}
106 0 0 if $has{'XMP '}
107 0 0 if $has{'EXIF'}
108 0 0 if $has{'ALPH'}
109 0 0 if $has{'ICCP'}
114 0 0 if $dirDat{'ICCP'}
126 8 26 if ($num < 8) { }
127 0 8 if $num
129 6 0 unless $addDirs->{'EXIF'} or $addDirs->{'XMP '} or $addDirs->{'ICCP'}
136 0 26 if ($len <= 0)
137 0 0 if ($len < 0) { }
0 0 elsif ($tag eq "\000\000\000\000") { }
145 0 0 if ($pass) { }
146 0 0 unless &Write($outfile, $buff)
157 0 28 if ($deletableGroup{$tag})
158 0 0 if ($et->{'DEL_GROUP'}{$deletableGroup{$tag}}) { }
0 0 elsif ($tag eq "XMP\000") { }
160 0 0 unless $raf->Seek($len2, 1)
161 0 0 if $pass
165 0 0 if $pass
169 2 0 if ($editDirs->{$tag} or $tag eq "" or $tag eq "XMP " and $addDirs->{'EXIF'})
171 8 2 if ($len2) { }
172 0 8 if $doneDir{$tag} and not $pass
174 0 8 unless $raf->Read($buff, $len2) == $len2
186 28 0 unless $tag eq $dir or $addDirs->{$dir} and $tag eq '' || $tag eq 'XMP ' && $dir eq 'EXIF'
189 6 6 unless ($pass)
192 2 4 if ($tag eq 'EXIF') { }
2 2 elsif ($dir ne $tag) { }
194 0 2 if ($buff =~ /^Exif\0\0/) { }
195 0 0 if ($et->{'DEL_GROUP'}{'EXIF'}) { }
201 0 0 unless $pass
222 3 3 if (ref $Image::ExifTool::RIFF::Main{$dir} eq "HASH")
227 3 3 $dir eq 'EXIF' ? :
231 12 0 if (defined $dirDat{$dir})
232 8 4 if ($dir eq $tag)
235 4 4 unless length $dirDat{$dir}
237 8 4 if (length $dirDat{$dir})
238 4 4 if ($pass) { }
240 4 0 unless $dir eq "ICCP"
243 0 4 $start ? :
247 0 4 $dirLen & 1 ? :
258 0 10 if (not $handledTag and length $buff)
260 0 0 if ($pass) { }
261 0 0 unless &Write($outfile, $tag, &Set32u($len), $buff)
273 6 12 if ($tag eq "VP8X")
275 0 6 if ($len2 < 10 or $raf->Read($buf2, $len2) != $len2)
279 3 3 if ($pass) { }
280 0 3 if ($deleteVP8X)
287 2 1 if $has{'XMP '}
288 2 1 if $has{'EXIF'}
289 0 3 if $has{'ICCP'}
291 0 3 unless &Write($outfile, $buff, $buf2)
300 0 6 if $dirDat{'ICCP'}
306 6 6 if ($pass) { }
308 0 6 unless &Write($outfile, $buff)
313 0 12 unless ($pass or defined $imageWidth)
315 0 0 if ($tag eq 'VP8 ' and $len2 >= 16) { }
0 0 elsif ($tag eq 'VP8L' and $len2 >= 6) { }
316 0 0 unless $raf->Read($buff, 16) == 16
318 0 0 if ($buff =~ /^...\x9d\x01\x2a/s)
324 0 0 unless $raf->Read($buff, 6) == 6
326 0 0 if ($buff =~ /^\x2f/s)
330 0 0 if $word & 1048576
335 6 6 if ($pass) { }
339 0 6 if $num > 65536
340 0 6 unless $raf->Read($buff, $num) == $num
341 0 6 unless &Write($outfile, $buff)
345 0 6 unless $raf->Seek($len2, 1)
349 3 3 if $pass
350 0 3 unless $raf->Seek(0, 0)
352 0 3 $err ? :