qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

Error when reading a big png #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.read a png larger than 240M 
2.Error when reading png

What is the expected output? What do you see instead?
a webp image file.
Error message, see below

D:\webp>cwebp.exe -q 80 a186-raw.png -o a186.webp
Error! Could not process file a186-raw.png
Error! Cannot read input picture

What version of the product are you using? On what operating system?
latest version on webp site

Please provide any additional information below.
run on XP (P4 3G 1G Ram)

Original issue reported on code.google.com by web06...@gmail.com on 23 May 2011 at 2:11

GoogleCodeExporter commented 8 years ago
What are the dimensions of this picture in pixels? If it has more than 2^31 
pixels then it can't be processed by this 32-bit application (I could try to 
build a 64-bit one if this is needed)

Original comment by mikol...@google.com on 23 May 2011 at 3:33

GoogleCodeExporter commented 8 years ago
Also, when you get passed this error, you may hit a limitation of the current 
WebP format of 16384 pixels in height and width.

Original comment by mikol...@google.com on 23 May 2011 at 3:40

GoogleCodeExporter commented 8 years ago
Hi,

The dimension is 11 728 x 11 040 in pixel

11 728 * 11 040 = 129477120

129477120 < 2147483648 =2^31

11 728 or 11 040 < 16 384

BR

Original comment by web06...@gmail.com on 23 May 2011 at 4:43

GoogleCodeExporter commented 8 years ago
Can you reproduce it with an empty (all white) PNG file of such dimensions. If 
so, can you attach it to this bug (it should compress well).

Original comment by mikol...@google.com on 23 May 2011 at 4:50

GoogleCodeExporter commented 8 years ago
An empty PNG kills my PC, no enough memory to save the image.
;)
BR

Original comment by web06...@gmail.com on 23 May 2011 at 5:30

GoogleCodeExporter commented 8 years ago
This error is probably due to an overflow from partition #0 (containing modes 
and segments). Only 512kB are available for this partition (due to the 
limitation of using 19bits to signal its size in the header).

For testing purpose, try using -q 0 and -segments 1. Compression will be 
extreme, but the resulting data should fit within partition #0's limit. This 
would rule out problem with the input picture.

Going forward, having the ability to tile these big pictures will help (both 
compression-wise but also to prevent this problem with partition #0 size).
A nicer error message would be helpful, though.

Original comment by pascal.m...@gmail.com on 23 May 2011 at 5:39

GoogleCodeExporter commented 8 years ago
I could not reproduce this with a white PNG image, but Ive created another PNG 
image that cannot be converted.

fails with "Error! Cannot encode picture as WebP"
cwebp hyperion2_cassini_big.png -o out.webp

works:
cwebp hyperion2_cassini_big.png -q 0 -segments 1 -o q0.webp

Original comment by martin.a...@gmail.com on 24 May 2011 at 7:35

Attachments:

GoogleCodeExporter commented 8 years ago
tried on a win7 32bit machine (cpu q6600 2.4Gx4 2G ram)
failed but for some different reasons

cwebp.exe -q 80 a186-raw.png -o a186.webp
Saving file 'a186.webp'
Error! Cannot encode picture as WebP

cwebp.exe -q 0 a186-raw.png -o a186.webp
Saving file 'a186.webp'
Error! Cannot encode picture as WebP

Tried with empty png in same dimension 11728x11040, OK for both qualities
cwebp.exe -q 0 "11728x11040.png" -o 11728x
11040-0.webp
Saving file '11728x11040-0.webp'
 218184 bytes Y-U-V-All-PSNR 48.13 99.00 99.00   49.89 dB
block count:  intra4: 1
              intra16: 505769  (-> 100.00%)
              skipped block: 505767 (100.00%)
bytes used:  header:             21  (0.0%)
             mode-partition: 218123  (100.0%)
 Residuals bytes  |segment 1|segment 2|segment 3|segment 4|  total
  intra4-coeffs:  |       0 |       0 |       0 |       3 |       3  (0.0%)
 intra16-coeffs:  |       4 |       0 |       0 |       0 |       4  (0.0%)
  chroma coeffs:  |       0 |       0 |       0 |       0 |       0  (0.0%)
    macroblocks:  |      99%|       0%|       0%|       0%|  505770
      quantizer:  |     127 |     127 |     127 |     127 |
   filter level:  |      19 |      14 |      12 |       9 |
------------------+---------+---------+---------+---------+-----------------
 segments total:  |       4 |       0 |       0 |       3 |       7  (0.0%)

cwebp.exe -q 80 "11728x11040.png" -o 11728x11040-q80.webp
Saving file '11728x11040-q80.webp'
 218174 bytes Y-U-V-All-PSNR 99.00 99.00 99.00   99.00 dB
block count:  intra4: 1
              intra16: 505769  (-> 100.00%)
              skipped block: 505769 (100.00%)
bytes used:  header:             17  (0.0%)
             mode-partition: 218120  (100.0%)
 Residuals bytes  |segment 1|segment 2|segment 3|segment 4|  total
  intra4-coeffs:  |       0 |       0 |       0 |       4 |       4  (0.0%)
 intra16-coeffs:  |       0 |       0 |       0 |       0 |       0  (0.0%)
  chroma coeffs:  |       0 |       0 |       0 |       0 |       0  (0.0%)
    macroblocks:  |      99%|       0%|       0%|       0%|  505770
      quantizer:  |      19 |      14 |      11 |      11 |
   filter level:  |       0 |       0 |       0 |       0 |
------------------+---------+---------+---------+---------+-----------------
 segments total:  |       0 |       0 |       0 |       4 |       4  (0.0%)

Original comment by web06...@gmail.com on 25 May 2011 at 7:17

GoogleCodeExporter commented 8 years ago
Failed as well with -segments 1
cwebp.exe -v -q 0 -segments 1 a186-raw.png -o a186-q0-s1.webp
Time to read input: 9.893s
Saving file 'a186-q0-s1.webp'
Error! Cannot encode picture as WebP

Original comment by web06...@gmail.com on 25 May 2011 at 7:32

GoogleCodeExporter commented 8 years ago
working on fix: better / finer error reporting.

Original comment by pascal.m...@gmail.com on 2 Jun 2011 at 7:58

GoogleCodeExporter commented 8 years ago
Please try:
 https://review.webmproject.org/#change,2402

It should report an error whenever there's a problem with the size of partition 
#0 (or else).

Tried:

cwebp hyperion2_cassini_big.png
No output file specified (no -o flag). Encoding will
be performed, but its results discarded.

Error! Cannot encode picture as WebP
Error code: 6 (PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k)

Original comment by pascal.m...@gmail.com on 2 Jun 2011 at 2:10