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 May 26th, 2000, 06:22 PM
uTired2 uTired2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 3 uTired2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to uTired2
I'm trying to create a php page to automatically display all images in a directory I specify, I want all the images to be thumbnailed on the fly, this is what I've come up with so far....

<?
$TheDirectory = dir($ImageDir);
while($Filename = $TheDirectory->read()) {

// Make sure we only show graphic files!
if ((strstr($Filename, '.jpg') <> False) | | (strstr($Filename, '.gif') <> False) | | (strstr($Filename, '.png') <> False)) {
// Get info about this image.
$ImageSize = GetImageSize($TheDirectory->path . $Filename);

// Create a thumbnail, try to keep the proportions correct
$ImageScale = $ImageSize[1] / $ImageSize[2];

$SourcePic = imagecreatefromjpeg ($TheDirectory->path . $Filename);
$DestPic = imagecreate(100, 100 * $ImageScale);

// Create a thumbnail from the image
imagecopyresized($DestPic, $SourcePic 0, 0, 0, 0, 100, 100 * $ImageScale, $ImageSize[1], $ImageSize[2]);

// Display the image
imagejpeg($SourcePic);

// Free up the resouces
imagedestroy($SourcePic);
imagedestroy($DestPic);
}
}

$TheDirectory->close();
?>

Ok, so $ImageDir is the directory name I send the page, and as you can see I've only set it up to handle jpg files atm.

So this isn't working, I just get a blank page what I need to know is...
- How do I find out what version of gd I'm using?
- Is there a way I can load a image, resize it then output it without using the gd functions? I would rather output the raw headers if possible but I'm not sure how, I'm not sure if my webhost is using the required version of gd, and I'd rather not have to hassle him for months to upgrade it.
- Does anyone know any examples of thumbnail gallerys I can download?

[This message has been edited by uTired2 (edited May 26, 2000).]

Reply With Quote
  #2  
Old May 27th, 2000, 03:33 AM
Natrak Natrak is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Oslo, Norway
Posts: 5 Natrak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I haven't messed with the image functions in php yet so I can't really help you, but you should be able to find out version of gd by using:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><? phpinfo(); ?>[/code]

N.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Displaying/Resizing Images

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