Jump to content
php.lv forumi

Ob start un end


cucumber

Recommended Posts

Es taisu es ierakstu bildes tadus no datu bazes, ar sho metodi, bet pec ta man pazud php mainigie. Kur var but vaina?

$a = "abc";

ob_start(); // start a new output buffer
  imagejpeg($resize,"",$quality);
  $ImageData = addslashes(ob_get_contents());
ob_end_clean();

echo $a; //nekas nav

Link to comment
Share on other sites

Izdorot ta $ImageData = addslashes(ob_end_clean()); kluda paliek.

Edited by cucumber
Link to comment
Share on other sites

Ir bilde uz servera, kuru padotu funkcijai, kas apstrada to (dabu augstumu, platumu), tad to bildi meginu samazinat un ierakstit ieksh db, nesaglabajot uz cieta diska.

 

 $im_data = getimagesize($infile);

$im=imagecreatefromjpeg($infile);	  
$resize=imagecreatetruecolor($w,$h);
imagecopyresampled($resize,$im,0,0,0,0,$w,$h,imagesx($im),imagesy($im));

ob_start(); // start a new output buffer
  imagejpeg($resize,"",$quality);
  $ImageData = addslashes(ob_get_contents());
ob_end_clean();

  //query izbilde, tikai tas nenotiek, jo pazud dati no ta
echo "aaaa"; //ari vairs neizpildisies	

imagedestroy($im);	
imagedestroy($resize);

Link to comment
Share on other sites

Risinajums, bija taka piektaja posta. Izradas ka f-ja bija dubleta un viena vieta jau biju izlabojis otru aizmisu izlabot.

Labak f-jas nedublet, kada library ierakstit.

Link to comment
Share on other sites

×
×
  • Create New...