EmperorZenos Posted January 24, 2009 Share Posted January 24, 2009 I have a script that makes a file randomly an image from it's same directory, and some of the images are a bit big. (I want to use them on a phpbb2 forum)So I'm wondering how can I resize the pics generated. <?php$dh = opendir(".");while (false !== ($file = readdir($dh))){if (preg_match('/.(jpg|gif|png)$/i', $file) and $file != "avatar.gif"){$filelist[] = $file;}}srand((double)microtime()*1000000);$picnum = rand(0, sizeof($filelist) - 1);header("Location: " . $filelist[$picnum]);closedir($dh);?> Link to comment Share on other sites More sharing options...
ProblemHelpPlease Posted January 24, 2009 Share Posted January 24, 2009 Is this any help to you http://uk2.php.net/imagecopyresized. I have used this in the past and found it very useful Link to comment Share on other sites More sharing options...
justsomeguy Posted January 25, 2009 Share Posted January 25, 2009 I posted a function to resize an image here:http://w3schools.invisionzone.com/index.php?showtopic=21889 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.