Branch Coverage

blib/lib/IIIF/Request.pm
Criterion Covered Total %
branch 69 74 93.2


line true false branch
33 33 53 if (@parts and $parts[0] =~ /^$REGION$/u)
35 12 21 if ($1) { }
8 13 elsif ($2) { }
43 1 7 if not $region_pct->[2] && $region_pct->[3] or grep {$_ > 100;} @$region_pct
47 36 49 if (@parts and $parts[0] =~ /^$SIZE$/u)
51 23 13 if ($5 // $6) // $8
53 11 25 if (defined $3)
55 1 10 if ($upscale) { }
59 2 8 if $size_pct == 0 or $size_pct > 100
66 9 74 if (@parts and $parts[0] =~ /^$ROTATION$/u)
72 6 3 $mirror ? :
75 7 76 if (@parts and $parts[0] =~ /^(($QUALITY)([.]($FORMAT))?|[.]($FORMAT))$/u)
81 3 80 if @parts
110 2 21 if ($self->{'region'} eq 'square') { }
3 18 elsif ($self->{'region_pct'}) { }
5 13 elsif ($self->{'region_px'}) { }
118 1 2 unless $w = pct2px($w, $width)
119 0 2 unless $h = pct2px($h, $height)
124 1 4 if $x >= $width and $y >= $height
126 3 18 if $region eq "0,0,$width,$height"
129 5 16 if ($region ne 'full')
133 5 16 if ($self->{'size_pct'})
136 3 2 unless pct2px($self->{'size_pct'}, $width) and pct2px($self->{'size_pct'}, $height)
142 10 8 unless ($size =~ /\^?max/u)
143 2 8 if ($self->{'size_pct'}) { }
146 0 2 if $upscale
150 0 1 unless $w or $h
151 1 5 if not $upscale and $h > $height || $w > $width
153 4 3 if ($w and $h) { }
2 1 elsif ($w) { }
1 0 elsif ($h) { }
154 3 1 if ($self->{'ratio'})
155 1 2 if ($w / $h > $width / $height) { }
172 2 5 if $upscale
175 2 7 if $size =~ /^\^?$width,$height$/u
179 0 17 defined $self->{'format'} ? :
197 1 89 defined $self->{'format'} ? :