Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

querying image resolutions with perl
Hello,
 
I’d like to write a Perl script that returns the X and Y resolution of a
given image file.  Does anyone know of a module that might support this
function?  Ideally it would support a wide variety of image file
formats.
 
Thanks
Tom

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.779 / Virus Database: 526 - Release Date: 10/19/2004
 


Report this thread to moderator Post Follow-up to this message
Old Post
Tom Proctor
10-24-04 08:55 PM


Re: querying image resolutions with perl

Tom Proctor wrote:

> Hello,

Hello,

> I’d like to write a Perl script that returns the X and Y resolution of a
> given image file.  Does anyone know of a module that might support this
> function?  Ideally it would support a wide variety of image file
> formats.

Try:

http://search.cpan.org/

Imager
Image::Magick
GD



HTH :)

Lee.M - JupiterHost.Net

Report this thread to moderator Post Follow-up to this message
Old Post
JupiterHost.Net
10-24-04 08:55 PM


Re: querying image resolutions with perl
On Sun, 24 Oct 2004, JupiterHost.Net wrote:

> Tom Proctor wrote:
> 
>
> Try:
>
> http://search.cpan.org/
>
> Imager
> Image::Magick
> GD

Or, more to the point, Image::Size:

use Image::Size;
# Get the size of globe.gif
($globe_x, $globe_y) = imgsize("globe.gif");
# Assume X=60 and Y=40 for remaining examples

use Image::Size 'html_imgsize';
# Get the size as 'width="X" height="Y"' for HTML generation
$size = html_imgsize("globe.gif");
# $size == 'width="60" height="40"'

use Image::Size 'attr_imgsize';
# Get the size as a list passable to routines in CGI.pm
@attrs = attr_imgsize("globe.gif");
# @attrs == ('-width', 60, '-height', 40)

use Image::Size;
# Get the size of an in-memory buffer
($buf_x, $buf_y) = imgsize(\$buf);
# Assuming that $buf was the data, imgsize() needed a reference to a scalar

A brief search on CPAN or Google should have had this near the top of
the list, had you tried to search before asking the list. If you're
doing a lot of graphics work, the book _Perl Graphics Programming_ is
good & worth taking a look at: <http://www.oreilly.com/catalog/perlgp/>


--
Chris Devers


Report this thread to moderator Post Follow-up to this message
Old Post
Chris Devers
10-25-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:31 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.