Jump to content
php.lv forumi

imagejpeg()


stencilz

Recommended Posts

	$file = $_FILES['file']['tmp_name'];

$new_image = imagecreatefromjpeg($file);

list($width,$height)=getimagesize($file);

$newheight = 80;
$newwidth = $width * $newheight / $height;

$tmp = imagecreatetruecolor($newwidth,$newheight);

imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);

$filename = "done/".$_POST['cat']."/small/".$_FILES['file']['name']."";
imagejpeg($tmp,$filename,100);

 

$filename ir 100% pareizs bet izmet

 

Warning: imagejpeg(): Unable to open 'done/1/small/h.jpg' for writing in...

 

lieki teikt ka nekāda h.jpg tur nemaz nav, tam ir jābūt tur izveidotam

 

kas varētu būt par kļūdu?

Link to comment
Share on other sites

×
×
  • Create New...