Jump to content
php.lv forumi

vitalja

Recommended Posts

...
  $image->setImageFormat('png');
  // output the new image
  header('Content-type: image/png');
  $this->response->body($image);

Lapa tiek taisīta Kohana freimworkā, fails kuram būtu jāizvada bilde izvada kodu: PNG IHDRgAMA utt.

izskatās, ka header rindiņa nedarbojas pariezi. Neizdodas atrast problēmu iespējams kādam ir doma, kāpēc netiek izveidota bilde.

 

Starp citu $this->response->body($image); ir vienīgā rindiņa ko izvadu.

Link to comment
Share on other sites

Tagat samainiju pēdējās divas rindiņas uz

$this->response->headers('Content-Type', 'image/png');
$this->response->body($image);

Viss darbojas daudz labāk, vissmaz tagat parādās tukša bilde, bet intuitīvi šķiet, ka šis kļudas iemesls ir, kas cits.

Link to comment
Share on other sites

Pārbaudi, vai tiešām visā kodā nekur neizvada tukšumu.

Pat iepriekš esošs aizverošais tags ?> ar tukšumu aiz tā, var visu sačakarēt.

Tik tiešām rodas Tab atstarpe pirms koda, bet vienīgā izvades reize ir $this->response->body($image);

mēģināju izvadīt arī ar echo vienalga tā atstarpe paliek, pat trim($image) funkciju izmēģināju tieši pirms izvades, izskatās, nav ne jausmas kā tā atstarpe varrasties. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...