Condition Coverage

blib/lib/Imager.pm
Criterion Covered Total %
condition 189 338 55.9


and 3 conditions

line !l l&&!r l&&r condition
645 32 36 55 not defined $combine and ref $self
664 68 0 8581 $self->{'IMG'} and builtin::blessed($self->{'IMG'})
1118 1 0 13 @_ != 1 and not ref $_[0]
1340 0 42 12 $bits and $bits == 64
1607 6 0 4 $input->{'maxbuffer'} and $input->{'maxbuffer'} == 1
1667 85 132 1 $input{'file'} and not $type
1681 216 0 0 $readers{$type} and $readers{$type}{'single'}
1723 0 0 18 $input{'xsize'} and $input{'ysize'}
1870 0 1 2 not $loaded and $error =~ /^Can't locate /
1894 0 1 2 not $loaded and $error =~ /^Can't locate /
1948 0 0 0 $warn_obsolete and $^W
2024 76 0 95 not $type and $input{'file'}
2035 171 0 0 $writers{$type} and $writers{$type}{'single'}
2107 3 0 0 not $type and $opts->{'file'}
2117 1 0 3 ref $img and builtin::blessed($img)
1 1 2 ref $img and builtin::blessed($img) and $img->isa("Imager")
2134 0 0 0 $writers{$type} and $writers{$type}{'multiple'}
2189 1 1 1 $opts{'file'} and not $type
2203 1 0 0 $readers{$type} and $readers{$type}{'multiple'}
2272 28 0 12 defined $input{$name} and exists $names->{$name}{$input{$name}}
2339 289 71 1 defined $opts{$name} and ref $opts{$name}
2353 1 0 1 defined $width and defined $height
2359 48 3 8 $opts{'xscalefactor'} and $opts{'yscalefactor'}
2376 34 6 19 $opts{'xpixels'} and $opts{'ypixels'}
6 0 19 $opts{'xpixels'} and $opts{'ypixels'} and $opts{'type'}
31 0 0 $opts{'constrain'} and ref $opts{'constrain'}
31 0 0 $opts{'constrain'} and ref $opts{'constrain'} and $opts{'constrain'}->can("constrain")
2572 0 0 0 $opts{'xexpr'} and $opts{'yexpr'}
2709 0 0 28 $channels >= 1 and $channels <= 4
2733 0 1 20 $opts{'src'} and $opts{'src'}->_valid_image("rubthrough")
2803 4 52 0 not defined $width and defined $opts{'src_maxx'}
2809 4 52 0 not defined $height and defined $opts{'src_maxy'}
2858 0 0 143 defined $opts{'dir'} and defined $xlate{$opts{'dir'}}
3092 1 0 1 $opts{'d1'} == 0 and $opts{'d2'} == 361
3107 24 1 8 $opts{'d1'} == 0 and $opts{'d2'} == 361
25 0 8 $opts{'d1'} == 0 and $opts{'d2'} == 361 and $opts{'aa'}
3150 47 2 13 $opts{'d1'} == 0 and $opts{'d2'} == 361
3181 0 0 211 exists $opts{'x1'} and exists $opts{'y1'}
3182 0 0 211 exists $opts{'x2'} and exists $opts{'y2'}
3214 1 0 4 not exists $opts{'points'} and exists $opts{'x'}
0 0 4 not exists $opts{'points'} and exists $opts{'x'} and exists $opts{'y'}
3258 0 0 10 exists $opts{'x'} and exists $opts{'y'}
3373 0 0 0 @{$opts{'x'};} and @{$opts{'x'};} == @{$opts{'y'};}
3395 0 0 89 exists $opts{'x'} and exists $opts{'y'}
3477 49 35 43 ref $color and UNIVERSAL::isa($color, "Imager::Color")
3484 1 1 124 exists $opts{'x'} and exists $opts{'y'}
3549 1 1 236 exists $opts{'x'} and exists $opts{'y'}
3657 151 0 49 ref $opts{'pixels'} and @{$opts{'pixels'};}
4032 0 0 5 $opts{'maps'} and $self->{'IMG'}
4210 0 0 3 defined $max_colors and $max_colors > 0
4243 0 0 5 defined $max_colors and $max_colors > 0
4353 1 9 1 $opts{'sample_size'} and $opts{'sample_size'} eq "float"
4448 113 2 0 not defined $type and $ext =~ /\A[a-zA-Z0-9_]{2,}\z/

or 2 conditions

line l !l condition
422 25 1 $_ = _color($_) or die $ERRSTR . "\n"
925 0 15 delete $hsh{'alpha'} || 0
1051 0 25 $hsh{'maxcolors'} || 256
1846 57 0 $@ || 'Unknown error'
2215 0 1 $opts{'allow_incomplete'} || 0
2372 14 31 $opts{'scalefactor'} || 0.5
2708 1 27 $opts->{'channels'} || 3

or 3 conditions

line l !l&&r !l&&!r condition
618 479 42 139 UNIVERSAL::isa($arg, "Imager::Color") or UNIVERSAL::isa($arg, "Imager::Color::Float")
698 5 1 1272 defined $hsh{'file'} or defined $hsh{'fh'}
6 0 1272 defined $hsh{'file'} or defined $hsh{'fh'} or defined $hsh{'fd'}
1 0 1272 defined $hsh{'file'} or defined $hsh{'fh'} or defined $hsh{'fd'} or defined $hsh{'callback'}
0 0 1272 defined $hsh{'file'} or defined $hsh{'fh'} or defined $hsh{'fd'} or defined $hsh{'callback'} or defined $hsh{'readcb'}
0 8 1264 defined $hsh{'file'} or defined $hsh{'fh'} or defined $hsh{'fd'} or defined $hsh{'callback'} or defined $hsh{'readcb'} or defined $hsh{'data'}
8 0 1264 defined $hsh{'file'} or defined $hsh{'fh'} or defined $hsh{'fd'} or defined $hsh{'callback'} or defined $hsh{'readcb'} or defined $hsh{'data'} or defined $hsh{'io'}
552 0 712 defined $hsh{'xsize'} or defined $hsh{'ysize'}
761 1 26 1 $input{'img'} || $input{'src'}
811 0 0 26 $src_right <= $src_left or $src_bottom < $src_top
901 1 1 44 $l == $r or $t == $b
905 1 1 42 $r < $l or $b < $t
924 6 9 0 delete $hsh{'colors'} || $empty_trim_colors
1002 42 0 0 $opts{'xsize'} || $self->getwidth
1003 42 0 0 $opts{'ysize'} || $self->getheight
1004 0 42 0 $opts{'channels'} || $self->getchannels
1049 24 1 527 $hsh{'type'} eq "paletted" or $hsh{'type'} eq "pseudo"
1282 5 0 9 exists $opts{'start'} || exists $opts{'count'}
1526 8 0 0 $input->{'callback'} or $input->{'readcb'}
1559 0 0 0 $input->{'callback'} || $input->{'readcb'}
1564 8 0 0 $input->{'callback'} || $input->{'readcb'}
1580 2 0 8 $input->{'callback'} or $input->{'writecb'}
1612 2 8 0 $input->{'callback'} || $input->{'writecb'}
1762 3 0 0 defined $opts{'single'} or defined $opts{'multiple'}
1784 3 0 0 defined $opts{'single'} or defined $opts{'multiple'}
1862 214 0 3 $formats_low{$type} or $readers{$type}
1886 168 0 3 $formats_low{$type} or $writers{$type}
2365 0 3 0 $opts{'scalefactor'} || $x_scale
2369 0 3 0 $opts{'scalefactor'} || $y_scale
2379 6 0 1 $opts{'type'} eq "nonprop" or $opts{'type'} eq "non-proportional"
2610 0 0 0 not exists $opts{'xopcodes'} or @{$opts{'xopcodes'};} == 0
2617 0 0 0 defined $OPCODES{$iop} or $iop =~ /^\d+$/
2627 0 0 0 not exists $opts{'yopcodes'} or @{$opts{'yopcodes'};} == 0
2634 0 0 0 defined $OPCODES{$iop} or $iop =~ /^\d+$/
2676 0 25 0 $width ||= $imgs[0]->getwidth
2677 0 25 0 $height ||= $imgs[0]->getheight
2877 0 11 0 defined $opts{'radians'} or defined $opts{'degrees'}
2883 13 5 10 $degrees == 90 or $degrees == 180
18 10 0 $degrees == 90 or $degrees == 180 or $degrees == 270
2902 0 11 0 $opts{'radians'} || $opts{'degrees'} * 3.14159265358979 / 180
2946 0 3 0 $opts{'xsize'} || $self->getwidth
2947 0 3 0 $opts{'ysize'} || $self->getheight
3491 7 2 115 ref $x or ref $y
3557 17 2 217 ref $x or ref $y
3578 3 0 1 $type eq "float" or $type eq "double"
3595 19 2 1 $type eq "float" or $type eq "double"
3883 1 2 11 $opts{'preset'} eq "gray" or $opts{'preset'} eq "grey"
0 0 10 $opts{'preset'} eq "red" or $opts{'preset'} eq "channel0"
0 0 10 $opts{'preset'} eq "green" or $opts{'preset'} eq "channel1"
3 0 7 $opts{'preset'} eq "blue" or $opts{'preset'} eq "channel2"
3900 0 1 0 $self->getchannels == 2 or $self->getchannels == 4
3919 0 0 0 $self->getchannels == 2 or $self->getchannels == 4
4218 0 0 3 $channels == 2 or $channels == 4
4542 0 0 0 $lang eq "C" or $lang eq "CPP"
4599 2 0 0 $_[1] != 1 or $_[0] != 0