in reply to Re^3: image resize error
in thread image resize error
well. i think the image resize does't get my pic, i tried the Image Resize module locally without cgi and works
but with cgi script i get
Image::Resize->new(): file '02111.JPG' does not exist#!/usr/bin/perl use strict; use warnings; use CGI; use File::Copy; use CGI::Carp 'fatalsToBrowser'; my $q = CGI->new; my $photo = $q->param("pic"); if ($photo){ my ($ext) = $photo =~ /([^.]+)$/; my $copydir = '/full/path/to/web/img/'; my $image = Image::Resize->new($photo); my $gd = $image->resize(100, 100); my $newfile = $copydir."011190.$ext"; my $upload_fh = $q->upload("pic"); open OUTFILE,'>',$newfile or die "$!"; print OUTFILE $gd->jpeg(); binmode OUTFILE; while (<$upload_fh>){ print OUTFILE; } close OUTFILE; } print << "HTM"; <h2>File upload</h2> <form method="post" action="" enctype="multipart/form-data"> Filename: <input type="file" name="pic"/><br/><br/> <input type="submit"/> </form> HTM
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: image resize error
by marto (Cardinal) on Oct 19, 2018 at 10:52 UTC | |
by LanX (Saint) on Oct 19, 2018 at 13:47 UTC | |
|