Mailinglisten-Archive |
Hallo,
bin mir nicht sicher, ob die vorherige Mail angekommen ist, also nochmal:
Ich will einen Bildupload machen und gehe wie folgt vor:
In Formular
<INPUT TYPE="file" NAME="in_thumb">
auf Folgeseite (inkl. resize, falls Bild zu gross):
if(isset($in_thumb) && $in_thumb!="none" && ($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;
}
unset($in_thumb);
}
dann soll das Bild gespeichert werden:
if(isset($arr['thumb']))
if(copy($arr['thumb'],
$CFG->HomeDir."/images/thn/".$arr['ID']."_thn.gif"))
{
$sql="UPDATE ".$CFG->db_tbl_pre."_tabelle ";
$sql.="SET thumb='".$arr['ID']."_thn.gif' WHERE ID='".$arr['ID']."' LIMIT
1";
if(!$result=mysql_query($sql))
die("DB-Fehler:<BR>".mysql_errno()." : ".mysql_error()."<BR>".$sql);
}
Jetzt bekomme ich immer wenn das Bild geresized werden soll die
Fehlermeldung:
Warning: imagegif: unable to open '/images/thn/temp.gif' for writing in ...
die Rechte sind 777 in dem Verzeichnis.
MfG
Bobby Eichholz
php::bar PHP Wiki - Listenarchive