Branch Coverage

blib/lib/PDL/IO/Pic.pm
Criterion Covered Total %
branch 81 214 37.8


line true false branch
89 0 0 if "PDL::IO::GD"->can("to_rpic")
0 14 if (eval { do { require PDL::IO::GD; "PDL::IO::GD"->can("write_Jpeg") if "PDL::IO::GD"->can("to_rpic") } })
93 0 0 if $pdl->ndims > 2 and $pdl->dim(0) == 3
98 0 0 $pdl->diff2->zcheck ? :
106 14 0 !$converter{'PNG'} ? :
0 14 !$converter{'JPEG'} && File::Which::which('pnmtojpeg') ? :
109 0 14 !$converter{'JPEG'} && File::Which::which('cjpeg') ? :
126 140 28 if defined $converter{$key}{'get'}
128 140 28 if defined $converter{$key}{'put'}
129 14 154 if (defined $converter{$key}{'Prefilt'})
130 14 0 if $converter{$key}{'Prefilt'} =~ /^\s*(\S+)\s+/
131 0 14 if $converter{$key}{'Wok'}
219 0 11 unless @_
224 0 11 if (ref $file) { }
232 9 2 if ref $hints
233 9 2 if (defined $hints->{'FORMAT'}) { }
238 0 9 unless exists $converter{$type} and $converter{$type}{'referral'} && $converter{$type}{'referral'}{'get'} || !($converter{$type}{'get'} =~ /NA/)
241 0 2 if $type =~ /UNKNOWN/
246 0 11 if (defined $converter{$type}{'referral'})
247 0 0 if (ref $converter{$type}{'referral'}{'get'} eq 'CODE') { }
255 11 0 if ($converter{$type}{'get'} and $converter{$type}{'get'} =~ /^NONE/) { }
260 0 0 if defined $hints->{'XTRAFLAGS'}
261 0 0 unless open $fh, "-|", @cmd, $file
263 0 0 if $PDL::IO::Pic::debug > 10
270 11 0 @frames == 1 ? :
409 0 5 if @_ < 2
415 3 2 if ref $hints
419 0 5 if (defined $referral)
420 0 0 if (ref $referral->{'put'} eq 'CODE') { }
427 2 3 if $PDL::IO::Pic::debug > 10
430 0 5 if (defined $hints->{'IFORM'}) { }
433 0 5 if $conv =~ /^\s*(ppm)|(cjpeg)/
434 0 5 if $conv =~ /^\s*pgm/
435 0 5 if $conv =~ /^\s*pbm/
436 5 0 if $conv =~ /^\s*(pnm)|(NONE)/
439 2 3 if $PDL::IO::Pic::debug > 10
442 5 0 if $conv =~ /^NONE/
443 2 3 if $PDL::IO::Pic::debug > 10
445 0 5 if defined $hints->{'IFORM'} and $hints->{'IFORM'} =~ /RAW/
446 0 5 if defined $hints->{'IFORM'} and $hints->{'IFORM'} =~ /ASCII/
512 3 3 @_ >= 2 && UNIVERSAL::isa($_[0], 'PDL') ? :
516 4 2 if $isrgb and not defined $out->gethdr && $out->gethdr->{'SIMPLE'}
517 3 3 if defined $dest
602 0 0 if $isrgb and not $args[1] =~ /\.fits$/i || ref $args[2] eq 'HASH' && $args[2]{'FORMAT'} =~ /fits/i
626 0 0 if @_ != 1
628 0 0 unless File::Which::which("ffmpeg")
629 0 0 unless open my $fh, "-|", ("ffmpeg", "-loglevel", "quiet", "-i"), $file, ("-f", "image2pipe", "-codec:v", "ppm", "-")
705 0 0 if @_ != 2
708 0 0 unless (File::Which::which("ffmpeg"))
715 0 0 if @Dims != 4 or $Dims[0] != 3 or $pdl->get_datatype != $PDL::IO::Pic::PDL_B
726 0 0 if $PDL::verbose
727 0 0 if $PDL::debug
728 0 0 unless open my $fh, "|-", ("ffmpeg", "-y", "-loglevel"), $loglevel, ("-f", "image2pipe", "-codec:v", "ppm", "-i", "-"), $file
770 6 2 (shift()) =~ /r/i ? :
771 6 2 $rw eq 'Rok' ? :
772 0 8 unless @_
774 0 8 unless defined $converter{$format}
782 2 0 if $ext =~ /^.([^;]*)/
793 0 2 unless defined $wmode
798 2 0 if ($wmode)
799 2 0 if $ext =~ /^(pbm)|(pgm)|(ppm)|(pnm)$/
800 0 0 if $ext =~ /^(jpg)|(jpeg)$/
801 0 0 if $ext =~ /^(tiff)|(tif)$/
802 0 0 if $ext =~ /^pcx$/
803 0 0 if $ext =~ /^rgb$/
804 0 0 if $ext =~ /^gif$/
805 0 0 if $ext =~ /^(r)|(rast)$/
806 0 0 if $ext =~ /^(iff)|(ilbm)$/
807 0 0 if $ext =~ /^ps/
808 0 0 if $ext =~ /^f(i?ts|it)$/
809 0 0 if $ext =~ /^png$/i
810 0 0 if $ext =~ /^xbm$/i
828 0 2 unless open my $fh, $file
832 0 2 if (not defined $len or $len != 12)
838 2 0 if $magic =~ /^P[1-6]/
839 0 0 if $magic =~ /(^GIF87a)|(^GIF89a)/
840 0 0 if $magic =~ /(^MM)|(^II)/
841 0 0 if $magic =~ /^(\377\330\377)/
842 0 0 if $magic =~ /^(\001\332)|(\332\001)/
843 0 0 if $magic =~ /^\131\246\152\225/
844 0 0 if $magic =~ /ILBM$/
845 0 0 if $magic =~ /^\012[\000-\005]/
846 0 0 if $magic =~ /%!\s*PS/
847 0 0 if $magic =~ /^SIMPLE \=/
848 0 0 if $magic =~ /^.PNG\r/
849 0 0 if $magic =~ /^#define\s+/
860 0 5 if defined $hints->{'CONVERTER'}
863 3 2 if (defined $hints->{'FORMAT'}) { }
868 0 3 unless exists $converter{$type} and $converter{$type}{'referral'} && $converter{$type}{'referral'}{'put'} || !($converter{$type}{'put'} =~ /NA/)
871 0 2 if ($type =~ /UNKNOWN/)
883 0 5 if defined $converter{$type}{'Prefilt'}
886 5 0 unless defined $flags
887 0 5 if defined $hints->{'XTRAFLAGS'}
888 0 5 if (defined $hints->{'COLOR'} and $hints->{'COLOR'} =~ /bwdither/)
904 0 4 if ($pdl->get_datatype >= $PDL::IO::Pic::PDL_L or $pdl->get_datatype == $PDL::IO::Pic::PDL_S or not $converter{$format}{'ushortok'} and $pdl->get_datatype == $PDL::IO::Pic::PDL_US)
907 1 0 if $PDL::IO::Pic::debug
913 0 5 unless $isrgb or @Dims == 2
916 5 0 unless defined $hints->{'COLOR'}
918 5 0 if ($iform =~ /P[NP]M/)
919 2 3 if $isrgb
920 3 2 if @Dims == 2 or $hints->{'COLOR'} =~ /bwdither/i
921 0 5 if $hints->{'COLOR'} =~ /bw/i
924 0 5 if ($isrgb and $iform =~ /P[B,G]M/)
928 0 5 if (defined $hints->{'LUT'})
929 0 0 if $isrgb
930 0 0 if $PDL::IO::Pic::debug
933 0 0 if $PDL::IO::Pic::debug