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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michal dot mikes at ecomma dot cz
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 08:01:29 2024 UTC