Hi,
While deploying my scripts Under Linux I'cannot use Image::Thumbnail to thumb an image.
here is the script
#!/usr/bin/perl
use CGI;
use Image::Thumbnail;
my $imgdir= "/var/www/upload";
my $query = new CGI;
uploadImage('test_upload_and_thumb.jpg');
sub uploadImage {
my $name = shift || '';
my $file = $query->upload('image');
open(LOCAL, ">$imgdir/$name") or print 'error';
my $file_handle = $query->upload('image');
+
binmode LOCAL;
while(<$file_handle>) {
print LOCAL;
}
close($file_handle);
close(LOCAL);
createImageMagickThumb("$name");
}
sub createImageMagickThumb {
my $filename = shift || '';
my $t = new Image::Thumbnail(
size => 55,
create => 1,
input => '$imgdir/$filename',
outputpath => '$imgdir/thumb.$filename',
);
print "Content-Type: text/html\n\n";
print "outputpath => '$imgdir/thumb.$filename'";
}
I didn't facing any error the file test_upload_and_thumb.jpg is uploaded but no thumb is created and no error in the server log.
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.