Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Dimensions of a jpg file

by steelrose (Scribe)
on May 18, 2005 at 15:27 UTC ( #458246=perlquestion: print w/replies, xml ) Need Help??
steelrose has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks,

I'd like to know if anyone knows of a simple way to determine the height and width of a .jpg file in perl. The upshot of this is that I could then build a window size based on the dimensions of the photo, and not have to manually open up each photo and copy it's dimensions to my HTML code.

Anyone do something similar now? How so?

If you give a man a fish he will eat for a day.
If you teach a man to fish he will buy an ugly hat.
If you talk about fish to a starving man, you're a consultant.

Replies are listed 'Best First'.
Re: Dimensions of a jpg file
by merlyn (Sage) on May 18, 2005 at 15:28 UTC
Re: Dimensions of a jpg file
by b10m (Vicar) on May 18, 2005 at 15:42 UTC

    I'd go for Image::Info


    All code is usually tested, but rarely trusted.
Re: Dimensions of a jpg file
by jhourcle (Prior) on May 18, 2005 at 16:10 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://458246]
Approved by ZlR
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-01-22 21:06 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (237 votes). Check out past polls.