Mailinglisten-Archive |
Hallo,
ich will einen Bilder-upload realisieren, jedoch sollen diese nur einen
einer gegebenen maximalgroesse gespeichert und spaeter dargestellt werden.
Folgendes habe ich jetzt:
if($in_thumb_type=="image/gif" || $pic_type=="image/jpg")
{
$Pic=getimagesize($in_thumb);
if(($tempX=$Pic[0]/70)>1 || ($tempY=$Pic[1]/90)>1)
{
if($tempX>$tempY)
{
$tempX=$Pic[0]/$tempX;
$tempY=$Pic[1]/$tempX;
}
else
{
$tempX=$Pic[0]/$tempY;
$tempY=$Pic[1]/$tempY;
}
$old_thumb=_(at)_imagecreatefromgif($in_thumb);
$new_thumb=imagecreate($tempX,$tempX);
imagecopyresized($new_thumb,$old_thumb,0,0,0,0,$tempX,$tempY,imagesx($old_th
umb),imagesy($old_thumb));
$arr['thumb']=imagegif($new_thumb,$CFG->thnDir."/temp.gif");
}
else
{
$arr['thumb']=$in_thumb;
}
}
else
print("Thumb war kein GIF oder JPG");
Funktioniert solange die Bilder den Vorgaben entsprechen, wenn sie jedoch zu
gross sind bekomme ich folgende Meldung:
Warning: Unable to open '/thn/temp.gif' for writing in *** on Line 19
Zeile 19 ist die mit imagegif().
Das Verzeichnis hat chmod 777.
Tips?
Thx & MfG
----------------------------------------
Mental-Design-Factory
Agentur für Web-Design und Kommunikation
http://www.mental-defact.de
Bobby Eichholz
----------------------------------------
php::bar PHP Wiki - Listenarchive