CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Image Upload

 



andy7t
User

Oct 27, 2003, 5:41 AM

Post #1 of 2 (417 views)
Image Upload Can't Post

Hello,

I'm using a simple script at the moment like this:

use CGI;

open(WFD,">$write_file");


while ($bytes_read=read($filepath,$buff,2096))
{
$size += $bytes_read;
binmode WFD;
print WFD $buff;
}



so that users can upload pictures to my site.


However, i need them all to be in one size- 200X150.

How would i do this. I would like it so that the image does not become distorted- so could this mean placing the picture around a white border if it does not fit.

I'm making a site like Ebay- the pictures on that don't get distorted.



Thanks,

Andrew


davorg
Thaumaturge / Moderator

Oct 27, 2003, 6:02 AM

Post #2 of 2 (416 views)
Re: [andy7t] Image Upload [In reply to] Can't Post

You'll need to look into an image manipulation module like GD or Image::Magick. Find them on CPAN.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives