|
This topic comprises 2 pages: 1 2
|
Author
|
Topic: Uploading images???
|
|
|
|
|
|
|
|
|
|
|
|
|
Adam Martin
I'm not even gonna point out the irony.
Posts: 3686
From: Dallas, TX
Registered: Nov 2000
|
posted 11-10-2002 03:25 AM
The following script lists all of the .gif files in a directory and displays their width and height attributes. I'm sure you could use the formulas in it to serve your purposes. Note that it's only for .gif files. I wasn't able to quickly come up with any information on how image size is embedded in a jpeg file.
code:
#!/usr/bin/perl# gifsize open (OFN,">-"); # use standard output as default if($#ARGV > -1) { # but allow redirection to a file name close OFN; open (OFN,">$ARGV[0]"); } # print list header print OFN sprintf("%-32s %-6s %-6s\n","Filename","Width","Height"); $w = ""; $h = ""; foreach $fn (<*.gif> ) { # list all .gif files if ($fn =~ /\.gif/) { # redundant for now, until I figure out .jpg format open (FH,$fn); binmode FH; read FH,$w,6; # skip first 6 bytes read FH,$w,2; # width read FH,$h,2; # height close FH; ($wl,$wh) = unpack("CC",$w); # there is probably a more ($hl,$hh) = unpack("CC",$h); # elegant way to do this $w = $wl + ($wh * 256); $h = $hl + ($hh * 256); print OFN sprintf("%-32s %6s %6s\n",$fn,$w,$h); } } close OFN;
| IP: Logged
|
|
|
|
|
All times are Central (GMT -6:00)
|
This topic comprises 2 pages: 1 2
|
Powered by Infopop Corporation
UBB.classicTM
6.3.1.2
The Film-Tech Forums are designed for various members related to the cinema industry to express their opinions, viewpoints and testimonials on various products, services and events based upon speculation, personal knowledge and factual information through use, therefore all views represented here allow no liability upon the publishers of this web site and the owners of said views assume no liability for any ill will resulting from these postings. The posts made here are for educational as well as entertainment purposes and as such anyone viewing this portion of the website must accept these views as statements of the author of that opinion
and agrees to release the authors from any and all liability.
|