【问题标题】:Read the PNG image as NSData, and some extra bytes appear将PNG图像读取为NSData,出现一些额外的字节
【发布时间】:2020-04-15 11:39:29
【问题描述】:

以上是使用iOS SDK读取图片的数据, 00000004 43674249 50002006 2cb87766 是额外的字节。 有谁知道这些字节是什么?

【问题讨论】:

    标签: ios objective-c swift png


    【解决方案1】:

    根据the official specifications,您的图片不是标准 PNG。您指出的字节构成有效的PNG chunk

    00000004 Data length
    43674249 Block ID "CgBI"
    50002006 4 bytes of proprietary information
    2CB87766 CRC checksum of the data block
    

    但是对于符合标准的 PNG 图像,块的位置和指示的类型无效。
    这表示图像是使用 Apple 的修改版pngcrush 处理的。有关块内容和其他与官方规范的偏差的非官方信息,请参阅http://iphonedevwiki.net/index.php/CgBI_file_format#Differences_from_PNG

    【讨论】:

    • 谢谢,这个问题困扰了我一段时间
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-17
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多