|
|
@ -95,8 +95,7 @@ sub save { |
|
|
|
bytes => $conf->{image_maxmem}, |
|
|
|
bytes => $conf->{image_maxmem}, |
|
|
|
); |
|
|
|
); |
|
|
|
# query image |
|
|
|
# query image |
|
|
|
my $image = Imager->new(file => $upload->asset->path) |
|
|
|
if (my $image = Imager->new(file => $upload->asset->path)) { |
|
|
|
or die(Imager->errstr() . "\n"); |
|
|
|
|
|
|
|
$file->{ftype} = 'i'; |
|
|
|
$file->{ftype} = 'i'; |
|
|
|
$file->{fext} = $image->tags(name => 'i_format'), |
|
|
|
$file->{fext} = $image->tags(name => 'i_format'), |
|
|
|
$file->{res_w} = $image->getwidth, |
|
|
|
$file->{res_w} = $image->getwidth, |
|
|
@ -107,6 +106,9 @@ sub save { |
|
|
|
my $path = $self->_file_path("${time}_tn", $conf->{thumbs_ext}, 'fullpath'); |
|
|
|
my $path = $self->_file_path("${time}_tn", $conf->{thumbs_ext}, 'fullpath'); |
|
|
|
$thumb->write(file => $path) |
|
|
|
$thumb->write(file => $path) |
|
|
|
or die $thumb->errstr; |
|
|
|
or die $thumb->errstr; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
# unsupported image, djvu, ... |
|
|
|
|
|
|
|
} |
|
|
|
} elsif ($file->{fmime} =~ m{^video/}o) { |
|
|
|
} elsif ($file->{fmime} =~ m{^video/}o) { |
|
|
|
$file->{ftype} = 'v'; |
|
|
|
$file->{ftype} = 'v'; |
|
|
|
} elsif ($file->{fmime} =~ m{^audio/}o) { |
|
|
|
} elsif ($file->{fmime} =~ m{^audio/}o) { |
|
|
|