File Coverage

blib/lib/Mojolicious/Plugin/Images/Service/Origin.pm
Criterion Covered Total %
statement 20 21 95.2
branch 4 8 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 30 35 85.7


line stmt bran cond sub pod time code
1             package Mojolicious::Plugin::Images::Service::Origin;
2 7     7   27 use Mojo::Base 'Mojolicious::Plugin::Images::Service';
  7         9  
  7         33  
3 7     7   893 use 5.20.0;
  7         20  
  7         177  
4 7     7   25 use experimental 'signatures';
  7         8  
  7         32  
5 7     7   642 use Imager;
  7         10  
  7         39  
6              
7 11 50   11 1 807 sub upload ($self, $id, $upload) {
  11 50       43  
  11         24  
  11         21  
  11         17  
  11         19  
8 11 50       34 $upload = $self->controller->req->upload($upload) unless ref $upload;
9 11 50       72 my $img = Imager::->new(data => $upload->slurp) or die Imager::->errstr;
10 0           $self->write($id, $img);
11             }
12              
13             1;
14              
15             __END__