How to autosize images from array of images using the php?

thelmanewyork

New Member
I have a problem with the autosizing of images when I get list of images from directory as an array using this code: \[code\]<?php if ($handle = opendir('directory_of_images')) { while (false !== ($pict = readdir($handle))) { if ($pict != "." && $pict != "..") { $thumbsp .= '<a href="http://stackoverflow.com/questions/15855869/#'.$pict.'"><image src="http://stackoverflow.com/questions/15855869/directory_of_images'.$pict.'" width="50" border="0" hspace="5" vspace="5" align="middle"></a>'; $thump .= '<p id="'.$pict.'" style="height:700px; margin-bottom:200px;"><br><img src="http://stackoverflow.com/questions/15855869/directory_of_images'.$pict.'" width="450px" align="top"></p>'; } } closedir($handle); }?>\[/code\]Now, I need to resize images with keep aspect ratio. I would like to resize the image, when the image width is greater than the image height, or vice versa. Any help would be appreciated.
 
Back
Top