Abend,
hab mal wieder ein Problem
Ich arbeite gerade an einer Gallery für ein größeres Projekt, und da brauch ich natürlich nen Bilderupload. Also Bild Hochladen, dann in die richtige größe bringen, speichern, thumb erstellen, thumb speichern.
Aber irgentwie wird ein leeres Bild (0px usw,) gespeichert
also das ist die Funktion, wenn ich ImageCopyResized usw. weg lasse und direkt das tmp Bild in ein leeres Zieh klappts.
*Hilfe*
Danke im Vorraus.
hab mal wieder ein Problem
Ich arbeite gerade an einer Gallery für ein größeres Projekt, und da brauch ich natürlich nen Bilderupload. Also Bild Hochladen, dann in die richtige größe bringen, speichern, thumb erstellen, thumb speichern.
Aber irgentwie wird ein leeres Bild (0px usw,) gespeichert
Code:
<?
function Resize ($old_pic)
{
include("global.php");
$old = GetImageSize ( $old_pic );
$old_width = $old[0];
$old_height = $old[1];
if($old_width<=$this->pic_width)
{
$this->pic_width=$old_width;
}
$old_img = ImageCreateFromJPEG ($old_pic);
$this->pic_height = $this->GetNewHeigth ( $old_height,$old_width );
$this->pic = ImageCreateTrueColor($this->pic_width,$this->pic_heigth);
ImageCopyResized($this->pic,$old_img,0,0,0,0,$this->pic_width,$this->pic_height,$old_width,$old_height);
if ( ImageJPEG($this->pic,'gallery/pics/'.$this->filename) )
{
return true;
} else {
FatalError( PIC_FAILED_RESIZING );
}
}
?>
*Hilfe*
Danke im Vorraus.