$img = Doctrine::getTable('img')->findOneBySlug('fotka'); header('Content-Type: image/jpeg'); echo $img['img'];