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

From: Date: Sun, 19 Jul 2015 16:42:02 +0000
Subject: Bug #69611 [Opn->Fbk]: imagecreatefrompng -> imagewebp conversion results in not valid webp file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194557@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
 Updated by:         cmb@php.net
 Reported by:        aron dot novak at agenceinovae dot com
 Summary:            imagecreatefrompng -> imagewebp conversion results
                     in not valid webp file
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            GD related
 Operating System:   Fedora release 21 (Twenty One)
 PHP Version:        5.6.8
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

This issue might be related to bug #66590. Please check, whether
the filesize of the broken WebP files is even or odd.


Previous Comments:
------------------------------------------------------------------------
[2015-07-11 12:05:51] cmb@php.net

Related To: Bug #70045

------------------------------------------------------------------------
[2015-05-11 13:56:10] aron dot novak at agenceinovae dot com

<?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] => 
)

------------------------------------------------------------------------
[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 (#194557) next »