Hos Computerworld it-jobbank er vi stolte af at fortsætte det gode partnerskab med folkene bag IT-DAY – efter vores mening Danmarks bedste karrieremesse for unge og erfarne it-kandidater.
/* Check if this image is PNG or GIF, then set if Transparent*/ if(($image_type == 1) OR ($image_type==3)) { imagealphablending($tmp, false); imagesavealpha($tmp,true); $transparent = imagecolorallocatealpha($tmp, 255, 255, 255, 127); imagefilledrectangle($tmp, 0, 0, $tn_width, $tn_height, $transparent); } imagecopyresampled($tmp,$src,0,0,0,0,$tn_width, $tn_height,$width,$height);
/* * imageXXX() only has two options, save as a file, or send to the browser. * It does not provide you the oppurtunity to manipulate the final GIF/JPG/PNG file stream * So I start the output buffering, use imageXXX() to output the data stream to the browser, * get the contents of the stream, and use clean to silently discard the buffered contents. */ ob_start();
switch ($image_type) { case 1: imagegif($tmp); break; case 2: imagejpeg($tmp, NULL, 70); break; // best quality case 3: imagepng($tmp, NULL, 0); break; // no compression default: echo ''; break; }
$final_image = ob_get_contents();
ob_end_clean();
return $final_image; }
Kaldes således : $image = scaleImageFileToBlob($_FILES['binFile']['tmp_name'],500,500);
$image smides så ind i blobfeltet i databasen...
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.