正如所指出的MartinR https://stackoverflow.com/users/1187415/martin-rPNG 文件存在一个名为CgBI http://iphonedevwiki.net/index.php/CgBI_file_format.
普通 PNG 文件的结构是 PNG 签名后跟 IHDR 块。
下面是普通 PNG 文件的十六进制表示形式的字节示例( xx 是具有变量值的占位符字节):
PNG Signature(8 bytes): 89 50 4E 47 0D 0A 1A 0A
=======Chunk start=======
IHDR Chunk:
IHDR chunk length(4 bytes): 00 00 00 0D
IHDR chunk type(Identifies chunk type to be IHDR): 49 48 44 52
Image width in pixels(variable 4): xx xx xx xx
Image height in pixels(variable 4): xx xx xx xx
Flags in the chunk(variable 5 bytes): xx xx xx xx xx
CRC checksum(variable 4 bytes): xx xx xx xx
=======Chunk end=======
具有 CgBI 扩展名的 PNG 文件具有这样的结构:PNG 签名后跟 CgBI 块,然后是 IHDR 块。
当我说扩展名时,请不要将其与“filename.png、filename.cgbi”混淆。它实际上是 PNG 文件结构方式的扩展。
下面是带有 CgBI 扩展名的 PNG 文件的十六进制表示的字节示例( xx 是具有变量值的占位符字节):
PNG Signature(8 bytes): 89 50 4E 47 0D 0A 1A 0A
=======Chunk start=======
CgBI Chunk:
CgBI chunk length(4 bytes): 00 00 00 04
CgBI chunk type(Identifies chunk type to be CgBI): 43 67 42 49
CgBI info flags(4 bytes): xx xx xx xx
CRC checksum(variable 4 bytes): xx xx xx xx
=======Chunk end=======
=======Chunk start=======
IHDR Chunk:
IHDR chunk length(4 bytes): 00 00 00 0D
IHDR chunk type(Identifies chunk type to be IHDR): 49 48 44 52
Image width in pixels(variable 4): xx xx xx xx
Image height in pixels(variable 4): xx xx xx xx
Flags in the chunk(variable 5 bytes): xx xx xx xx xx
CRC checksum(variable 4 bytes): xx xx xx xx
=======Chunk end=======
虽然 PNG 文件会在所有图像查看器上呈现,但扩展名 CgBI 可能会也可能不会在所有图像查看器上呈现,具体取决于它们为此类文件提供的支持。
MacOS 预览可以显示此类图像,iOS 上的 UIImageView 也可以显示我的示例图像集中的文件(带有 CgBI 扩展名的 PNG)。