PHPで画像ファイルを指定しconvert -resizeをしてます。
1.HTMLの記述(画像を表示する呼び出し元)
<img src="resize.php?imgp=画像ファイルパス+ファイル名" alt="呼び出し元画像">
2.PHPの記述(resize.php)
<?php if (!empty($_GET['imgp'])) { $image_file = $_GET['imgp']; } $img = new mimage($image_file); $newWidth = 100; //画像のリサイズ幅(px)を指定 $newHeight = ($img->height / ($img->width / $newWidth)); header('Content-type: image/jpeg'); echo $img->resizeimage($newWidth, $newHeight); class mimage { var $img_path; var $width; var $height; var $font_file_path; function mimage($image_path) { $this->img_path = $image_path; $image_info = getimagesize($this->img_path); $this->width = $image_info[0]; $this->height = $image_info[1]; } function resizeimage($max_w, $max_h, $new_file_dir = null, $new_file_name = null) { if ($new_file_name) { $new_file_path = $new_file_dir .'/'. $new_file_name; $cmd = "convert ". $this->img_path ." -resize {$max_w}x{$max_h} {$new_file_path} "; system($cmd); } else { $cmd = "convert ". $this->img_path ." -resize {$max_w}x{$max_h} -"; return shell_exec($cmd); } } } ?>
まあ、でも、画像の劣化とかを考えると、photoshopでリサイズした画像をそのまま表示した方が良いのかな。