Solved

Header from files ?

Posted on 2000-02-21
4
142 Views
Last Modified: 2010-03-05

Can I get size info of a file (GIF, JPG etc.) from its header ?

After I upload a file using the "file" input type, I require the width and height of the uploaded image in my Perl program.
How can I get it?
0
Comment
Question by:leoleo
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
dmag earned 50 total points
Comment Utility
You want to use the Image::Size module. It knows 7 different file formats. Usage is simple:

use CGI ':all';
use Image::Size 'attr_imgsize';
print img({-SRC => '/server/images/arrow.gif',
  attr_imgsize('/server_root/server/images/arrow.gif')});


Get it from: http://www.cpan.org/authors/id/RJRAY/
0
 

Author Comment

by:leoleo
Comment Utility

Thanks.

But how do I find out if a particular module is already present in our server?
0
 

Author Comment

by:leoleo
Comment Utility

Thanks.

But how do I find out if a particular module is already present in our server?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
perldoc -l Image::Size
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now