hi
einfach als thumb.php ( oder sonst wie ) abspeichern und
wie folgt aufrufen
<img scr="thumb.php?imgpath=xyz.jpg&b=100">
du kannst entweder die neue breite oder die neue hoehe angeben, wird proportional geaendert
Code:
if( !$src = @imagecreatefromjpeg($imgpath) )
{
die( "Datei ist kein JPG" );
}
$src_b = imagesx($src);
$src_h = imagesy($src);
if( isset( $h ) )
{
$neue_b = $src_b * $h / $src_h;
}
elseif( isset( $b ) )
{
$neue_b = $b;
$h = $src_h * $b / $src_b;
}
if( !isset( $neue_b ) )
{
$neue_b = $src_b;
}
if( !isset( $h ) )
{
$h = $src_h;
}
$dst = imagecreate($neue_b, $h);
imagecopyresized($dst, $src, 0, 0, 0, 0, $neue_b, $h, $src_b,
$src_h);
header("Content-type:image/jpeg");
imagejpeg($dst);
imagedestroy($dst);
hoffe es klappt auf anhieb