forumnz Posted April 7, 2007 Share Posted April 7, 2007 My script here displays all the images in a directory with a caption underneath each one. I need to have it so that the images will be no more than 100x100 px. However, I dont want an image which is 200x300 to be reduced to 100x100 because that would look stupid. I also cant do anything like 50% because some images are already 100x100 and the rest are all different sizes. Please help if possible. <?php $d = dir("sport_motocross"); //echo "Handle: " . $d->handle . "\n"; //echo "Path: " . $d->path . "\n"; while (false !== ($entry = $d->read())) { if ($entry == "." || $entry == "..") { continue; }elseif (!ereg('gif|jpg|jpeg|png', $entry)) { continue; } echo "<div align=center class=float>" . "<img src=" . "http://www.designervision.co.nz/magik/gallery/sport_motocross/" .$entry. "\n" . "/>" . "<br />" . "<p>" .$entry. "</p>" . "</div>"; } $d->close(); ?> Link to comment https://forums.phpfreaks.com/topic/46031-resize-an-image/ Share on other sites More sharing options...
forumnz Posted April 7, 2007 Author Share Posted April 7, 2007 Help? Link to comment https://forums.phpfreaks.com/topic/46031-resize-an-image/#findComment-223667 Share on other sites More sharing options...
forumnz Posted April 7, 2007 Author Share Posted April 7, 2007 Anyone? Link to comment https://forums.phpfreaks.com/topic/46031-resize-an-image/#findComment-223677 Share on other sites More sharing options...
forumnz Posted April 7, 2007 Author Share Posted April 7, 2007 Please? Link to comment https://forums.phpfreaks.com/topic/46031-resize-an-image/#findComment-223733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.