PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 18th, 2000, 05:11 PM
Chrille Chrille is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Sweden
Posts: 384 Chrille User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 20 h 39 m 54 sec
Reputation Power: 14
Hello all,

Does anybody know how to open an image (gif/jpg) end echo its size?

I know the syntax for gifs, but it do not work on jpegs.

Best regards,
Christoffer

Reply With Quote
  #2  
Old March 18th, 2000, 07:24 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Central Florida, USA
Posts: 2,306 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 51 sec
Reputation Power: 60
Right on the PHP web site it says the GetImageSize() function works on GIF, JPEG, or PNG files.
http://www.php.net/manual/function.getimagesize.php3

What syntax are you using?

Reply With Quote
  #3  
Old March 19th, 2000, 02:51 AM
Chrille Chrille is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Sweden
Posts: 384 Chrille User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 20 h 39 m 54 sec
Reputation Power: 14
IT WORKS!!! Thank you VERY much!!! :-)

I was using this syntax:

<?php
// notice these are backticks (`), not quotes (')
// the file function is called and fed the location of the gif file
$output = `file /full/path/to/gif`;

// the $output string contains lots of info, so we split it up by the ,'s.
$vals = split( ",",$output);

// we display a trimmed version of the third part, as taht contains the dimensions.
// the [2] part is because array indexes start at 0, not 1
echo trim($vals[2]);

?>

Best Regards,
Christoffer :-D

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Image size

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap