I’ve come across a very strange issue. If you put the following in the Controller.php, the captcha image of the contact form doesn’t display at all!!! I’ve even tried with Yii 1.1.16 and happens the same.
that is rather obvious - captcha is rendered with controller action, so if you put some output in controller init() function it will be sent prior to image data…
the url displaying form IS NOT the url for captcha image. Use firebug or similar dev tool and check form HTML in browser and check what is the url in <img> tag whre captcha should be visible.
You may also use "network" tab of dev tool and reload page, then check what real request is made and what is the server response.