Bug #73555 [Asn->Sus]: imagepng() doesn't properly report failure
| From: | cmb@php.net | Date: | Thu, 17 Nov 2016 13:34:05 +0000 |
| Subject: | Bug #73555 [Asn->Sus]: imagepng() doesn't properly report failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205435@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73555&edit=1
ID: 73555
Updated by: cmb@php.net
Reported by: cmb@php.net
Summary: imagepng() doesn't properly report failure
-Status: Assigned
+Status: Suspended
Type: Bug
Package: GD related
Operating System: *
PHP Version: 5.6Git-2016-11-17 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Unfortunately, this issue can't be resolved, because GD's image
output functions don't return success/failure[1]. I'm suspending
this ticket until this is resolved.
[1] <https://github.com/libgd/libgd/issues/347>
Previous Comments:
------------------------------------------------------------------------
[2016-11-17 13:18:58] cmb@php.net
Description:
------------
imagepng() and other output functions don't properly report
failure. For instance, if a read-only stream is passed to
imagepng(), the function returns TRUE without any warning or
notice, but obviously the image has not been written to the file.
Test script:
---------------
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug.png';
touch($filename);
$stream = fopen($filename, 'r');
$im = imagecreatetruecolor(100, 100);
var_dump(imagepng($im, $stream));
var_dump(filesize($filename));
Expected result:
----------------
bool(false)
int(0)
Actual result:
--------------
bool(true)
int(0)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73555&edit=1