From aa583644d10d1fab446871adb0cb7a975a6f08dc Mon Sep 17 00:00:00 2001 From: Jonathan Polley Date: Sat, 22 Dec 2018 02:04:58 -0800 Subject: [PATCH] Replace Image::Size with Image::Magick for performance --- index.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.pl b/index.pl index c2b4ce8..025dce5 100755 --- a/index.pl +++ b/index.pl @@ -5,7 +5,7 @@ use CGI qw/:standard/; use PDF::Create; use Data::Dumper; -use Image::Size; +use Image::Magick; my $annotations; read_annotations(); @@ -17,6 +17,13 @@ print_input(); } +sub imgsize { + my ($img_name) = @_; + my $img = new Image::Magick; + $img->Read($img_name); + return $img->Get("columns", "rows"); +} + sub print_input{ print <