Bug #69611 [Fbk->Opn]: imagecreatefrompng -> imagewebp conversion results in not valid webp file

From: Date: Mon, 11 May 2015 13:56:11 +0000
Subject: Bug #69611 [Fbk->Opn]: imagecreatefrompng -> imagewebp conversion results in not valid webp file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192619@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69611&edit=1

 ID:                 69611
 User updated by:    aron dot novak at agenceinovae dot com
 Reported by:        aron dot novak at agenceinovae dot com
 Summary:            imagecreatefrompng -> imagewebp conversion results
                     in not valid webp file
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            GD related
 Operating System:   Fedora release 21 (Twenty One)
 PHP Version:        5.6.8
 Block user comment: N
 Private report:     N

 New Comment:

<?php
print_r(gd_info());
Array
(
    [GD Version] => 2.1.0
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [T1Lib Support] => 1
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] => 1
    [XBM Support] => 1
    [JIS-mapped Japanese Font Support] => 
)


Previous Comments:
------------------------------------------------------------------------
[2015-05-11 13:14:02] cmb@php.net

I can't reproduce this issue on Windows 7 with PHP 5.6.8 and [GD
Version] => bundled (2.1.0 compatible). Which version of libGD do
you use (see gd_info() or phpinfo())?

------------------------------------------------------------------------
[2015-05-09 04:05:37] aron dot novak at agenceinovae dot com

Description:
------------
I was able to convert a jpeg to webp using $im = imagecreatefromjpeg($logo); imagewebp($im);
But the same failed from certain png file.
With a random jpeg file, using imagecreatefromjpeg, it works fine.

Test script:
---------------
<?php

$logo = 'http://download.gna.org/libre-nord/comm/Tux/tux_npdc.png';
$im = imagecreatefrompng($logo);
$temp = tempnam(sys_get_temp_dir(), 'gd');
imagewebp($im, $temp);
imagedestroy($im);
system("display $temp\n");

Expected result:
----------------
The image should be displayed.

Actual result:
--------------
display: insufficient image data in file `/tmp/gdC9IboF' @ error/webp.c/ReadWEBPImage/303.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69611&edit=1


Thread (5 messages)

« previous php.bugs (#192619) next »