php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41057 imagepng creates incorrect sized png
Submitted: 2007-04-11 19:37 UTC Modified: 2007-04-12 17:14 UTC
From: rempargo at gmail dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.2.1 OS: Windows XP Home
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rempargo at gmail dot com
New email:
PHP Version: OS:

 

 [2007-04-11 19:37 UTC] rempargo at gmail dot com
Description:
------------
imagepng creates incorrect sized png file if imagecreatetruecolor parameters are smaller then 26.

e.g. 25 x 25 becomes 31 x 31.

The problems only occurs with imagepng, not with imagejpg nor with imagegif.

Reproduce code:
---------------
<?php
header ("Content-type: image/png");


$im = @imagecreatetruecolor(25, 25) 
		or die("Cannot Initialize new GD image stream");

imagepng($im,null,0);

imagepng($im,'test.png',0);
imagejpeg($im,'test.jpg',100);
imagegif($im,'test.gif');
imagegd2($im,'test.raw');


imagedestroy($im);
?> 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-11 19:50 UTC] tony2001@php.net
Please put the result image somewhere, so we can take a look at it.
 [2007-04-11 19:53 UTC] tony2001@php.net
Cannot reproduce anything like that.
Check your image viewer.
 [2007-04-12 17:11 UTC] rempargo at gmail dot com
It was indeed my viewer (VuePrint 8.0), it gave the wrong size.
I was misled, because .gif and .jpg were correct in this viewer.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 10 16:01:32 2024 UTC