use Data::Dumper;
use Image::Magick;
use YAML::XS;
-
-#use KCatch;
+use KCatch;
#
# Libre10
# Copyright 2013 yukikaze,long.inus
$outputpathjpg = $outputpath_rs_jpg;
}
if ( -e $outputpathjpg ) {
+ system
+"jpegtran -progressive -copy none -outfile $outputpathjpg.out -optimize $outputpathjpg";
+ if ( -e "$outputpathjpg.out" ) {
+ system "rm $outputpathjpg";
+ system "mv $outputpathjpg.out $outputpathjpg";
+ }
$size = -s $outputpathjpg;
print "Content-type: image/jpeg\n";
print "Content-length:", $size, "\n";
print $cgi->header( -type => "text/html", -charset => "utf-8" );
print $cgi->start_html( -title => "rec10 pdf search", -lang => "ja-JP" );
print "error<br>";
- print "pdftk \"$pdfpath\" cat $b - $e output \"/tmp/rec10pdf/ "
- . basename($pdfpath) . "\"";
+ #print "pdftk \"$pdfpath\" cat $b - $e output \"/tmp/rec10pdf/ "
+ # . basename($pdfpath) . "\"";
+ print "pdfimages -f $pagenum -l $pagenum -j '$pdfpath' $outputpath";
}
sub generate_unique_key {
#$image=$image->convert(preset => 'noalpha');
$image->Resize( width => $width, height => $height, blur => 0.8 );
$image->Write($resized_img_path);
- system
-"jpegtran -progressive -copy none -outfile $resized_img_path.out -optimize $resized_img_path";
- if ( -e "$resized_img_path.out" ) {
- system "rm $resized_img_path";
- system "mv $resized_img_path.out $resized_img_path";
- }
+ #system "jpegoptim --max=40 --strip-all $resized_img_path";
+ #system
+#"jpegtran -progressive -copy none -outfile $resized_img_path.out -optimize $resized_img_path";
+ #if ( -e "$resized_img_path.out" ) {
+ # system "rm $resized_img_path";
+ # system "mv $resized_img_path.out $resized_img_path";
+ #}
}