php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58855 one ico image cannot be converted to png
Submitted: 2009-09-09 21:07 UTC Modified: 2010-01-27 14:42 UTC
From: guozheng dot ge at gmail dot com Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.6 OS: rhel-4.x
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guozheng dot ge at gmail dot com
New email:
PHP Version: OS:

 

 [2009-09-09 21:07 UTC] guozheng dot ge at gmail dot com
Description:
------------
get the favicon from http://www.jetphotos.net/favicon.ico and save it to disk

then, use this sample code to convert it to png, there is no error or exception, but the png output contains nothing

tried to run identify -verbose favicon.ico and did not get any error output, did convert favicon.ico favicon.png and there is no error either, it is just the png output cannot be displayed

somehow firefox can display the favicon, try go to http://www.jetphotos.net and favicon is shown next to the address, safari cannot display the favicon though

Reproduce code:
---------------
<?php
try
{
$im = new Imagick();
$im->setFormat('ico');
$im->readImageBlob(file_get_contents('favicon.ico'));
$im->flattenImages();
$im->setFormat('png');

$data = $im->getImageBlob();
header('Content-Type: image/png');
header('Content-Length: ' . strlen($data));
echo $data;
}
catch (Exception $ex)
{
    header('Content-Type: text/plain');
    $output = 'exception happened';
    header('Content-Length: ' . strlen($output));
    echo $output;
}
?>

Expected result:
----------------
if the original ico image has errors, Imagick or ImageMagick should return error or Exception

Actual result:
--------------
conversion to PNG is successful, but the result is a blank or non-displayable image

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-27 14:42 UTC] mkoppanen@php.net
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

This looks like an issue ImageMagick.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 23:01:30 2024 UTC