How to use PNG's IDAT chunk?

前端 未结 3 422
鱼传尺愫
鱼传尺愫 2021-02-04 12:12

I\'m trying to understand how data are stored into IDAT chunk. I\'m writing a little PHP class and I can retrieve most of chunks information but what I get for IDAT doesn\'t mat

3条回答
  •  抹茶落季
    2021-02-04 12:49

    To add to @Andreas (+1) parsing, two things to note:

    1. A PNG file can have (and often has) many IDAT chunks, they must be concatenated to recover the compressed zlib stream. http://www.w3.org/TR/PNG/#10CompressionFSL

    2. Gzip/Compress/Deflate are all related but are not exactly the same. PNG uses deflate/inflate. I'd try with gzdeflate/gzinflate

提交回复
热议问题