0
我有圖像自動調整大小的問題,當我得到的圖像列表從目錄中使用此代碼的數組:如何使用php自動化圖像數組中的圖像?
<?php
if ($handle = opendir('directory_of_images')) {
while (false !== ($pict = readdir($handle))) {
if ($pict != "." && $pict != "..") {
$thumbsp .= '<a href="#'.$pict.'"><image src="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="directory_of_images'.$pict.'" width="450px" align="top"></p>';
}
}
closedir($handle);
}
?>
現在,我需要調整與保持縱橫比的圖像。當圖像寬度大於圖像高度時,我想調整圖像大小,反之亦然。任何幫助,將不勝感激。
謝謝,我知道,但我不知道要插入到該代碼。 – user2253137 2013-04-06 21:02:36