Branch Coverage

blib/lib/IIIF/Request.pm
Criterion Covered Total %
branch 77 82 93.9


line true false branch
33 33 63 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 46 49 if (@parts and $parts[0] =~ /^$SIZE$/u)
51 28 18 if ($5 // $6) // $8
53 11 35 if (defined $3)
55 1 10 if ($upscale) { }
59 2 8 if $size_pct == 0 or $size_pct > 100
66 9 84 if (@parts and $parts[0] =~ /^$ROTATION$/u)
72 6 3 $mirror ? :
75 7 86 if (@parts and $parts[0] =~ /^(($QUALITY)([.]($FORMAT))?|[.]($FORMAT))$/u)
81 3 90 if @parts
110 2 28 if ($self->{'region'} eq 'square') { }
3 25 elsif ($self->{'region_pct'}) { }
5 20 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 25 if $region eq "0,0,$width,$height"
129 5 23 if ($region ne 'full')
133 5 23 if ($self->{'size_pct'})
136 3 2 unless pct2px($self->{'size_pct'}, $width) and pct2px($self->{'size_pct'}, $height)
148 2 23 if ($size eq '^max' and $maxHeight)
155 15 10 unless ($size =~ /\^?max/u)
156 2 13 if ($self->{'size_pct'}) { }
159 0 2 if $upscale
163 0 2 unless $w or $h
164 2 6 if not $upscale and $h > $height || $w > $width
166 7 4 if ($w and $h) { }
3 1 elsif ($w) { }
1 0 elsif ($h) { }
167 5 2 if ($ratio)
168 2 3 if ($w / $h > $width / $height) { }
185 5 6 if $upscale
188 3 10 if $size =~ /^\^?$width,$height$/u
192 5 18 if ($maxHeight)
193 3 2 if $size =~ /^\^?(\d+),(\d+)$/u
194 3 2 if $width > $maxWidth or $height > $maxHeight
198 0 20 defined $self->{'format'} ? :
216 1 98 defined $self->{'format'} ? :