How do you use a DeflateStream on part of a file?

前端 未结 1 873
面向向阳花
面向向阳花 2021-01-01 06:27

I\'m working on a solution to my other question which is reading the data in the \'zTXt\' chunks of a PNG. I am as far as locating the chunks in the file, and reading the z

相关标签:
1条回答
  • 2021-01-01 07:16

    After all this time, I've finally found the problem. The data is in zlib format, which has a bit more data stored than just using DEFLATE alone. The file is read properly if I just read the 2 extra bytes in right before I get the compressed data.

    See this feedback page. (I did not submit that one.)

    I'm wondering now. The value of those two bytes are 0x78 and 0x9C respectively. If I find values other than those, should I assume the DEFLATE is going to fail?

    0 讨论(0)
提交回复
热议问题