php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22185 problem with creating images
Submitted: 2003-02-12 06:37 UTC Modified: 2003-02-12 10:21 UTC
From: michal dot mikes at ecomma dot cz Assigned:
Status: Not a bug Package: *Graphics related
PHP Version: 4.3.0 OS: WINNT4.0
Private report: No CVE-ID: None
 [2003-02-12 06:37 UTC] michal dot mikes at ecomma dot cz
I have a simple script that create image. Everything works right since I put "session_start()" into the script. Then result isn't short PNG image, but large BMP image.

MM

<?
header("Content-Type:image/png");
//session_start();
$im = imagecreate (50, 250); 
$bgcolor = ImageColorAllocate ($im, 0x77, 0x77, 0x77); 
$textcolor = ImageColorAllocate ($im, 0x00, 0x00, 0x00); 
$font = "./arial";
ImageTTFText ($im, 35, 90, 40, 230, $textcolor, $font, "text"); 
Imagepng ($im); 
ImageDestroy ($im); 
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-12 10:21 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

I am assuming you have session.use_trans_sid enabled, meaning that PHP will try to modify the input data by inserting session is where needed. Since your output is binary data (image file) this option will most likely result in image corruption.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 17:01:27 2019 UTC