php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69611 imagecreatefrompng -> imagewebp conversion results in not valid webp file
Submitted: 2015-05-09 04:05 UTC Modified: 2015-08-02 04:22 UTC
From: aron dot novak at agenceinovae dot com Assigned: cmb (profile)
Status: No Feedback Package: GD related
PHP Version: 5.6.8 OS: Fedora release 21 (Twenty One)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-05-09 04:05 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-11 13:14 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2015-05-11 13:14 UTC] 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-11 13:56 UTC] aron dot novak at agenceinovae dot com
-Status: Feedback +Status: Open
 [2015-05-11 13:56 UTC] 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-07-19 16:42 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-07-19 16:42 UTC] cmb@php.net
This issue might be related to bug #66590. Please check, whether
the filesize of the broken WebP files is even or odd.
 [2015-08-02 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 07:01:24 2019 UTC