|
|
@@ -232,12 +232,14 @@ sub get_page_image { |
|
|
|
} |
|
|
|
else { |
|
|
|
if ( ! -r $dst ) { |
|
|
|
system(sprintf("convert %s -resize %s%s %s", |
|
|
|
my $cmd = sprintf("convert %s -resize %s%s %s", |
|
|
|
$src, |
|
|
|
$wh eq 'h' ? 'x' : '', |
|
|
|
$size, |
|
|
|
$dst |
|
|
|
)); |
|
|
|
); |
|
|
|
print STDERR "CMD=$cmd\n"; |
|
|
|
system($cmd); |
|
|
|
} |
|
|
|
|
|
|
|
$imgfile = $dst; |
|
|
@@ -252,37 +254,6 @@ sub get_page_image { |
|
|
|
return $img; |
|
|
|
} |
|
|
|
|
|
|
|
sub gen_thumbnail { |
|
|
|
my($original, $cache, $wh, $size) = @_; |
|
|
|
|
|
|
|
if ( -r $original ) { |
|
|
|
system(sprintf("convert %s -resize %s%s %s", |
|
|
|
$original, |
|
|
|
$wh eq 'h' ? 'x' : '', |
|
|
|
$size, |
|
|
|
$cache |
|
|
|
)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
sub gen_error_img { |
|
|
|
my($wh, $size) = @_; |
|
|
|
|
|
|
|
my $src = $conf->{page}{error_img}; |
|
|
|
my $dst = sprintf("%s/error_img-%s%s.jpeg", $conf->{path}{cache}, $wh, $size); |
|
|
|
|
|
|
|
if ( ! -r $dst ) { |
|
|
|
my $cmd = sprintf("convert %s -resize %s%s %s", |
|
|
|
$src, |
|
|
|
$wh eq 'h' ? 'x' : '', |
|
|
|
$size, |
|
|
|
$dst); |
|
|
|
print STDERR "IMG: $cmd\n"; |
|
|
|
system($cmd); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# create an empty document object. |
|
|
|
sub api_v1_POST_documents { |
|
|
|
my($id, $qs, $post, $user) = @_; |