rich731 has asked for the wisdom of the Perl Monks concerning the following question:
This works ok with images but not with PDFs. My guess is I need to do some kind of conversion to the PDF but can figure out how. Thanks in advance for any help. Richsub read_image_file { my $fh = shift; # filename/file handle my $img = new Image::Magick; my ($full, $thumb, $err); # read full-size image directly from upload file (read ($fh, $full, -s $fh) == -s $fh) or error ("Can't read image file: $!"); # produce jpg from pdf (this is where i'm lost because i get a can +'t convert error) # produce thumbnail from full-size image $err = $img->BlobToImage ($full); error ("Can't convert image data: $err") if $err; $err = $img->Scale (geometry => "150x194"); error ("Can't scale image file: $err") if $err; $thumb = $img->ImageToBlob (); return ($full, $thumb); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF to JPG for MySQL
by ww (Archbishop) on Jun 26, 2008 at 04:09 UTC | |
|
Re: PDF to JPG for MySQL
by leocharre (Priest) on Jun 26, 2008 at 12:46 UTC | |
by scorpio17 (Canon) on Jun 26, 2008 at 16:13 UTC | |
by leocharre (Priest) on Jun 26, 2008 at 18:29 UTC | |
by rich731 (Beadle) on Jun 27, 2008 at 01:19 UTC | |
|
Re: PDF to JPG for MySQL
by Anonymous Monk on Jun 27, 2008 at 05:06 UTC |