Branch Coverage

blib/lib/Image/ExifTool/WritePNG.pl
Criterion Covered Total %
branch 80 134 59.7


line true false branch
23 56 42 unless defined $crc
24 56 42 unless defined $pos
25 98 0 unless defined $len
28 1 97 unless (@crcTable)
32 1024 1024 $c & 1 ? :
56 12 1 if $n > 36
71 2 2 if ($rawType ne $Image::ExifTool::PNG::stdCase{'exif'} and eval { do { require Compress::Zlib } })
74 3 1 if (not defined $profile) { }
76 1 2 if (ref $rawType) { }
77 0 1 unless $deflate
82 0 2 if ($rawType eq $Image::ExifTool::PNG::stdCase{'zxif'}) { }
88 1 2 if ($deflate)
90 0 1 unless defined $buff
102 1 0 if ($deflate)
104 1 0 if (defined $buf2)
125 1 9 if ($et->{'ADD_DIRS'}{'ICC_Profile'})
130 1 0 if (defined $buff and length $buff)
132 0 1 unless defined $profileName
133 1 0 if (&WriteProfile($outfile, \$profileName, \$buff))
140 5 5 if ($et->{'ADD_PNG'})
143 10 0 unless $et->{'ADD_PNG'}{$tag}
147 0 5 if (%addBeforePLTE)
166 0 3 if $dir eq "IFD0"
168 3 0 if (not $nonStandard) { }
0 0 elsif ($et->{'DEL_GROUP'}{$dir} or $et->{'DEL_GROUP'}{$saveDir}) { }
170 0 3 if $dir eq "EXIF"
186 3 12 if ($tagInfo->{'SubDirectory'}) { }
187 3 0 if ($tagInfo->{'Name'} eq 'XMP') { }
195 0 12 if $et->Options("Compress")
196 1 11 if ($lang) { }
0 11 elsif ($et->{'OPTIONS'}{'Charset'} ne 'Latin' and $val =~ /[\x80-\xff]/) { }
0 11 elsif ($tagInfo->{'iTXt'}) { }
205 0 15 if ($comp)
207 0 0 if (eval { do { require Compress::Zlib } }) { }
209 0 0 if $deflate
210 0 0 if (defined $compVal) { }
213 0 0 unless (length $compVal < length $val)
224 0 0 if ($warn and $comp == 1)
229 4 11 if ($iTXt) { }
0 11 elsif (defined $compVal) { }
231 0 4 defined $compVal ? :
233 1 3 if $iTXt == 1
241 0 15 defined $compVal ? :
254 10 10 if (@add) { }
266 1 13 if $tagInfo->{'FakeTag'}
269 0 13 unless $nvHash->{'IsCreating'} or $et->IsOverwriting($nvHash) > 0
271 13 0 if (defined $val)
272 0 13 if $nvHash->{'EditOnly'}
274 12 1 if ($tagInfo->{'Table'} eq \%Image::ExifTool::PNG::TextualData) { }
283 0 13 unless &Write($outfile, $hdr, $data, $cbuf)
290 38 10 unless $et->{'ADD_DIRS'}{$dir}
296 4 6 if ($dir eq 'IFD0') { }
0 6 elsif ($dir eq 'XMP') { }
1 5 elsif ($dir eq 'IPTC') { }
0 5 elsif ($dir eq 'ICC_Profile') { }
1 4 elsif ($dir eq 'PNG-pHYs') { }
297 2 2 unless $specified
311 2 0 if (defined $buff and length $buff)
312 0 2 unless &WriteProfile($outfile, $chunk, \$buff)
319 0 0 if (defined $buff and length $buff and &Image::ExifTool::XMP::ValidateXMP(\$buff, "r"))
330 0 0 unless &Write($outfile, $hdr, $buff, $cbuf)
339 1 0 if (defined $buff and length $buff)
340 0 1 unless &WriteProfile($outfile, "iptc", \$buff, "IPTC")
347 0 0 if (defined $buff and length $buff)
348 0 0 unless &WriteProfile($outfile, "icm", \$buff, "ICC")
357 1 0 if (defined $buff and length $buff)
361 0 1 unless &Write($outfile, $hdr, $buff, $cbuf)