ich habe mit einem vor Freund eine kleine Fotoupload seite für unseren Jahrgang zu machen, und wir benutzen so ein vorgefertiges Ding (Shimmie-2.1.1), das kann aber die Bilder beim Upload nicht runterrechnen (512x512) und da wollten wir das selber reinschreiben.
- Code: Alles auswählen
private function eigene_function($bildpfad) {
$info = getimagesize($bildpfad);
$width = $info[0];
$height = $info[1];
if($width > 512) {
$height2 = ($height*(512/$width));
$width2 = 512;
$imageblub = imagecreatefromstring($this->read_file($bildpfad));
$neuesbild = imagecreatetruecolor($width2, $height2);
imagecopyresampled($neuesbild, $imageblub, 0, 0, 0, 0, $witdh2, $height2, $width, $height);
unlink($bildpfad);
imagejpeg($imageblub, $bildpfad, 100);
}
if($height > 512) {
$height2 = 512;
$width2 = ($width*(512/$height));
$imageblub = imagecreatefromstring($this->read_file($bildpfad));
$neuesbild = imagecreatetruecolor($width2, $height2);
imagecopyresampled($neuesbild, $imageblub, 0, 0, 0, 0, $witdh2, $height2, $width, $height);
unlink($bildpfad);
imagejpeg($imageblub, $bildpfad, 100);
}
}
Also ein Fehler kommt beim upload nicht, aber es wird nicht runtergerechnet, wisst ihr warum? (Wenn der zusammenhang fehlt, http://rapidshare.com/files/88152903/main.php.html hier is die ganze php datei)
danke für eure hilfe!
