PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Images » Image_Graph » Bug #2832

GD always outputs PNG

Details

Submitted2004-11-25 23:21 UTC
Fromoliver at burtchen dot com
Assignednosey
StatusClosed
PackageImage_Graph
PHP Version5.0.2
Roadmaps(Not assigned)

Comments

[2004-11-25 23:21 UTC] oliver at burtchen dot com

Description:
------------
Using Image_Graph-0.3.0dev2-pre:

The GD-driver always outputs PNG to the browser, if you don't set a file name. The only way to get JPG-output is to set a filename ending with '.jpg', even if you don't need the file.

[2004-11-26 07:19 UTC] pear dot nosey at veggerby dot dk

True it does, I'll add an option, so that you can specify output format, i.e. something like:

$Graph->done(array('output' => 'jpg'));

[2004-11-26 16:22 UTC] oliver at burtchen dot com

Well, thanks for your reply. I saw in CVS (driver.php) there is a $param['format'] for the driver-factory methode to distinguish between PNG and JPG. But it's not used by GD at the end. So what's with it?

Second I saw a typo in gd.php where

function done($param = false)
{
parent::done($param);
if (($param === false) or (!isset($param['filename']))) {
$output = 'png';
if (($param !== false) and (isset($param['output']))) {
-----> $outout = $param['output'];
}

should be

-----> $output = $param['output'];

Third, I like Image_Graph very much!!! ;-)