Issue 606 in webp: PNG image is not opening

184 views
Skip to first unread message

bobi8… via monorail

unread,
Mar 14, 2023, 6:46:53 AM3/14/23
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606

What steps will reproduce the problem?

exec('cwebp -q 85 -mt -metadata all -resize 380 263 no_image.png -o no_image.webp')

What is the expected output? What do you see instead?
output is small 3x3 silver image, should be output same image as original in size 380x263

What version of the product are you using? On what operating system?
libwebp-1.3.0, Linux

Please provide any additional information below.
i attack the current file and i cant open after resize

Attachments:
no_image.png 23.2 KB

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

bobi8… via monorail

unread,
Mar 14, 2023, 6:51:15 AM3/14/23
to webp-d...@webmproject.org

Comment #1 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c1

(No comment was entered for this change.)

Attachments:
no_image.webp 24.3 KB

pasca… via monorail

unread,
Mar 14, 2023, 7:33:51 AM3/14/23
to webp-d...@webmproject.org

Comment #2 on issue 606 by pasca...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c2

Hi,

strangely, it seems the no_image.webp file contains two VP8X chunks, which is likely the source of confusion for Chrome:

> webpinfo -diag no_image.webp
File: no_image.webp
RIFF HEADER:
File size: 24918
Chunk VP8X at offset 12, length 18
ICCP: 0
Alpha: 1
EXIF: 0
XMP: 1
Animation: 0
Canvas size 480 x 331
Chunk VP8X at offset 30, length 18
Error: Already seen a VP8/VP8L/VP8X chunk when parsing VP8X chunk.
Errors detected.

(the canvas size seems wrong too).

bobi8… via monorail

unread,
Mar 14, 2023, 8:13:02 AM3/14/23
to webp-d...@webmproject.org

Comment #3 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c3

is there something that i can do to fix this issue ?

bobi8… via monorail

unread,
Mar 14, 2023, 8:17:20 AM3/14/23
to webp-d...@webmproject.org

Comment #4 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c4

is there something that i can do to fix this issue ? Like to change something in original image

bobi8… via monorail

unread,
Mar 14, 2023, 8:31:35 AM3/14/23
to webp-d...@webmproject.org

Comment #5 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c5


is there something that i can do to fix this issue ? Like to change something in original image

My bad for size of canvas, is correct because -resize $with $height are dynamic parameters and sometime they change

jz… via monorail

unread,
Mar 14, 2023, 10:10:05 PM3/14/23
to webp-d...@webmproject.org

Comment #6 on issue 606 by jz...@google.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c6

Was there any other processing done to the file after the encode by cwebp? Can you share more information about the environment you're running on? Is that php doing the exec()? If I use the binaries from 1.3.0 [1] or a build from the tip of the tree, I can't reproduce this. As Pascal mentioned there's an additional VP8X chunk at the start of the file:

uploaded version:

0000000 52 49 46 46 4e 61 00 00 57 45 42 50 56 50 38 58
R I F F N a nul nul W E B P V P 8 X <--- this is the first
0000020 0a 00 00 00 14 00 00 00 df 01 00 4a 01 00 56 50
nl nul nul nul dc4 nul nul nul _ soh nul J soh nul V P <--- this is the second
0000040 38 58 0a 00 00 00 14 00 00 00 df 01 00 4a 01 00
8 X nl nul nul nul dc4 nul nul nul _ soh nul J soh nul
0000060 41 4c 50 48 0e 17 00 00 01 f7 27 24 48 f0 ff 78
A L P H so etb nul nul soh w ' $ H p del x
0000100

local copy:
0000000 52 49 46 46 c2 67 00 00 57 45 42 50 56 50 38 58
R I F F B g nul nul W E B P V P 8 X <--- only one
0000020 0a 00 00 00 14 00 00 00 df 01 00 4a 01 00 41 4c
nl nul nul nul dc4 nul nul nul _ soh nul J soh nul A L
0000040 50 48 84 17 00 00 01 19 c5 6d db 46 90 91 a7 ba
P H eot etb nul nul soh em E m [ F dle dc1 ' :
0000060 ff c2 39 3a 42 44 ff 27 a0 ee f0 56 1c 0f 71 a7
del B 9 : B D del ' sp n p V fs si q '
0000100

[1] https://developers.google.com/speed/webp/docs/precompiled

bobi8… via monorail

unread,
Mar 15, 2023, 3:58:03 AM3/15/23
to webp-d...@webmproject.org

Comment #7 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c7

Yes exec() is doing by php 7.0 version, there is not other processings done after exec(). I fix that issue by openning original image in photoshop and export again with default settings (see attached image), now the new exported image look different in my computer than the one i tried before (see attached image).
Look like something in original image (no_image.png attached to topic) was not correct

PhP Code:

$options = '-q '.$quality.' -mt -metadata all -resize '.(int)$width.' '.(int)$height;
$command = 'cwebp ' . $options . ' ' . DIR_IMAGE . $input_file . ' -o ' . DIR_IMAGE . $output_file;
$return_var = null;
exec($command, $output, $return_var);

// Check if the command was successful or not
if ($return_var !== 0) {
$error_message = date('Y-m-d')." Command failed with exit status $return_var: $command .\n";
file_put_contents('error_image_log', $error_message, FILE_APPEND);
}

Attachments:
export.png 34.0 KB
diff.png 8.4 KB

jz… via monorail

unread,
Mar 15, 2023, 7:49:31 PM3/15/23
to webp-d...@webmproject.org

Comment #8 on issue 606 by jz...@google.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c8

I don't see any issue with no_image.png or the cwebp output from that file, both running cwebp directly and using the php script. They both contain an alpha channel which renders correctly, similar to what is shown in export.png.

What I'd like to try to figure out is how the webp file became corrupted; there should only be one VP8X chunk. Can you reproduce this reliably using the php script and no_image.png? What is the output of cwebp -version? If this reliably reproduces for you can you try to remove some options, first -mt and then -resize to see if the issue is still present.

bobi8… via monorail

unread,
Mar 16, 2023, 5:52:37 AM3/16/23
to webp-d...@webmproject.org

Comment #9 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c9

I can reproduce this issue every time with attached file no_image-ORIGINAL.png

exec('cwebp -version') -> 0.3.0


Test with attached file: no_image-ORIGINAL.png
The issue i have is comming from -metadata all

cwebp -q 85 -mt -metadata all -resize 480 331 no_image.png -o no_image-480x331.webp
Output -> attached image - no_image-480x331-BROKEN.webp

cwebp -q 85 -mt -resize 480 331 no_image.png -o no_image-480x331.webp
Output -> attached image - no_image-480x331-WORKING.webp


Test with attached file: no_image-NEW.png
No issue with -metadata all

cwebp -q 85 -mt -metadata all -resize 480 331 no_image.png -o no_image-480x331.webp
Output -> attached image - no_image-480x331-NEW.webp

Attachments:
no_image-480x331-BROKEN.webp 24.3 KB
no_image-480x331-WORKING.webp 9.9 KB
no_image-ORIGINAL.png 23.2 KB
no_image-480x331-NEW.webp 12.2 KB
no_image-NEW.png 9.3 KB

jz… via monorail

unread,
Mar 16, 2023, 9:38:35 PM3/16/23
to webp-d...@webmproject.org
Updates:
Labels: v0.4.0
Status: Fixed

Comment #10 on issue 606 by jz...@google.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c10


> I can reproduce this issue every time with attached file
> no_image-ORIGINAL.png
>
> exec('cwebp -version') -> 0.3.0

Thanks for the detail. This version is quite old (we're currently at 1.3.0). If
you can please upgrade, you'll get better and faster encodes, and fewer bugs.
This one was fixed in v0.4.0 [1].

[1] https://chromium.googlesource.com/webm/libwebp/+/b5b2e3c7f5de3c3087a08465efcbadc673b59762

bobi8… via monorail

unread,
Mar 17, 2023, 6:48:43 AM3/17/23
to webp-d...@webmproject.org

Comment #11 on issue 606 by bobi8...@gmail.com: PNG image is not opening
https://bugs.chromium.org/p/webp/issues/detail?id=606#c11

Sorry guys i ask my hosting company to install this https://developers.google.com/speed/webp/download on my VPS but they install some old stuff for some reason

Thank you
Reply all
Reply to author
Forward
0 new messages