homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

Perl and images
Can perl manipulate images?

 2:50 pm on Jun 16, 2004 (gmt 0)

I have, as usual, a question.

Can perl manipulate images? Specifically, could I make a perl script where people upload images into a database and then the database script automatically renames the image and makes a corresponding thumbnail?

Any suggestions will be appreciated.




 2:52 pm on Jun 16, 2004 (gmt 0)

P.S. I should have mentioned that I ask about Perl because that's the only language I (kind of) know. I could probably work with something else, but I'm basically clueless on anything except Perl and I don't, obviously, know that too well.

Again, thanks in advance.


 3:01 pm on Jun 16, 2004 (gmt 0)

It sure can! The easiest approach is to use Perl in combination with the GD library [boutell.com]


 8:37 pm on Jun 16, 2004 (gmt 0)

Check out Image::Thumbnail or Image::GD::Thumbnail to help you with this.



 1:31 pm on Jun 17, 2004 (gmt 0)

Image::Magick is another good one, there are perl bindings on CPAN, or just use the convert executable.



 5:42 pm on Jun 17, 2004 (gmt 0)

Wow, lots of stuff to look through.

It'll take me a while to figure out how to use it, but that (DBŠImageMagick) is definitely what I need.

Thanks all!


 8:03 pm on Jun 17, 2004 (gmt 0)

Checkout imagemagick/perlmagick. I'm using this right now to create thumbnails and automatically tag information from a form right on to the image (like submitter info).

Only problem I've seen is between different version of perl and/or imagemagick. For some reason when I moved the same perl program to another machine the tagging jumped by about 10 pixel in relation to the image. Spent a long time trying to figure it out... and failed. I ended up just added code to change the positioning by 10 pixels. :)


 9:11 pm on Jun 18, 2004 (gmt 0)

I know this is a Perl forum, but you seemed to indicate that you only ask about Perl because that's what you know. If you do Perl, you would probably find yourself very comfortable in the PHP arena.

As to the othe suggestions, my first thought as well was to use image::magick


 9:56 am on Jul 18, 2004 (gmt 0)

I've used the Perl bindings for ImageMagick to create thumbnails with great success. You can set the width and height max for each one (120px works well by the way). It is very fast and only took about 30 minutes to index and thumbnail 10,000 images on my windows box (including the database calls and copying files from a staging area to the live server).

A former coworker of mine uses ImageMagick in his photoblog business (mod_perl) and loves it. Think of having the basics of Photoshop (or Elements I should say) accessible via a webpage to get an idea.

If you would like snippets I am sure I could dig something up in this myriad of files I call a site, just let me know.

I can't comment on any php solutions since I'm still of the school that php isn't a solution. (Sorry, not a flame, just a small opinion).

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved