Hum... Have a look at this : http://forum.symfony-project.org/index.php/m/52933/ - it talks about files ending with blank characters.
If it doesn't work, call exit; instead of return sfView::NONE; :) 2009/10/12 Ahmed <ghaliano2...@gmail.com> > > Hi, Thanks for reply > > it dosn't work men, > i have the same output. > (0x0 empty image) > > On 12 oct, 11:17, Alexandre SALOME <alexandre.sal...@gmail.com> wrote: > > You must disable the debug bar : > > > > sfConfig::set('sf_web_debug', false); > > > > Alexandre > > > > 2009/10/12 Ahmed <ghaliano2...@gmail.com> > > > > > > > > > > > > > Hi all; > > > I use symfony 1.2.9 > > > I have a strange error in ouputing image with symfony , so i have a > > > simple function to create image > > > public static function genCaptcha($pass){ > > > $image = ImageCreatetruecolor(100, 20); > > > $clr_white = ImageColorAllocate($image, 255, 255, 255); > > > $clr_black = ImageColorAllocate($image, 0, 0, 0); > > > imagefill($image, 0, 0, $clr_black); > > > > > // *** Set the image height and width *** > > > imagefontheight(15); > > > imagefontwidth(15); > > > > > // *** Add the passcode in white to the image *** > > > imagestring($image, 5, 30, 3, $pass, $clr_white); > > > > > // *** Throw in some lines to trick those cheeky bots! > > > *** > > > imageline($image, 5, 1, 50, 20, $clr_white); > > > imageline($image, 60, 1, 96, 20, $clr_white); > > > imageline($image, 5, 1, 100, 50, $clr_white); > > > // *** Output the newly created image in jpeg format *** > > > imagejpeg($image); > > > > > // *** Clear up some memory... *** > > > imagedestroy($image); > > > } > > > > > And in the action i write: > > > public function executeShowCaptcha(sfWebRequest $request) > > > { > > > $response = $this->getResponse(); > > > $response->setContentType('image/jpeg'); > > > > > myTools::genCaptcha(uniqid()); > > > > > $this->setLayout(false); > > > > > return sfView::NONE; > > > } > > > i use it in a template like this <img src="<?php echo url_for('home/ > > > showCaptcha')?>" /> > > > But i dont see any image in my template and whene i try to point it > > > directly on the url like : > > >http://127.0.0.1/test/frontend_dev.php/home/showCaptcha > > > also i dont see the generated image > > > > > NOTE: this script work outside symfony > > > Thanks. > > > Cordially Ahmed > > > > -- > > Alexandre Salomé -- alexandre.sal...@gmail.com > > > -- Alexandre Salomé -- alexandre.sal...@gmail.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---