这个PNG文件有什么特别之处? [英] What's so special about this PNG file?

查看:117
本文介绍了这个PNG文件有什么特别之处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此PNG 文件无法从我的应用上传到3d-派对服务器.它总是报告此错误:

This PNG file can not be uploaded from my app to a 3d-party server. It always reports this error:

多部分有图像吗?

does multipart has image?

我确定多部分编码是正确的.没有问题,从我的应用程序上传了成千上万张图片.这是第一次.

I'm sure multipart encoding is correct. Tens of thousands of images are uploaded from my app without this issue. It it the first time.

我猜想这个PNG文件有一些特别之处,我证明了这一点:

I guess there is something special about this PNG file and I proved it:

  1. Dropbox iOS应用无法显示图像.
  2. Tweetbot无法上传.错误消息是无法识别的媒体类型".

因此,此PNG文件确实很特殊,很多应用程序和服务器无法正确处理它.但是我不知道它有什么特别之处,并希望比我更了解PNG的人能提供帮助.谢谢.

So this PNG file is indeed special and quite some apps and servers don't handle it properly. But I don't know what's so special about it and hope someone who know PNG better than me can help. Thanks.

推荐答案

它是 CgBI 文件,而不是PNG文件,很可能是由苹果的流氓修改后的pngcrush制成的.

It is a CgBI file, not a PNG, most likely made with Apple's rogue modified pngcrush.

此类文件的字节12-15中始终包含"CgBI","IHDR"所属.

Such files always contain "CgBI" in bytes 12-15, where "IHDR" belongs.

CgBI文件可以通过以下几种应用程序转换为有效的PNG文件(透明区域受到不可修复的损坏)

CgBI files can be converted to valid PNG files (except that the transparent areas are irreparably damaged) by several applications, including

  • Jongware的 pngdefry
  • Apple的"pngcrush"(但不是真正的 pngcrush )
  • 上述CgBI Wiki页面上列出的其他
  • Jongware's pngdefry
  • Apple's "pngcrush" (but not the real pngcrush)
  • others listed on the above-referenced CgBI wiki page

以下是文件中的前几个字节:

Here are the first few bytes in your file:

$ od -c test.png | head -4
0000000 211   P   N   G  \r  \n 032  \n  \0  \0  \0 004   C   g   B   I
0000020   P  \0     002   + 325 263 177  \0  \0  \0  \r   I   H   D   R
0000040  \0  \0  \0   `  \0  \0  \0   `  \b 006  \0  \0  \0 342 230   w
0000060   8  \0  \0  \0       c   H   R   M  \0  \0   z   %  \0  \0 200

这些字节表示以下内容:

Those bytes represent the following:

PNG signature 0-7
CgBI length 8-11
"CgBI" 12-15
CgBI data 16-19
CgBI CRC 20-23
IHDR length 24-27 (should be in 8-11)
"IHDR" 28-31 (should be in 12-15)
width 32-35 (should be in 16-19)
height 36-39 (should be in 20-23)
bit depth 40 (should be in 24)
color type 41 (should be in 25)
compression 42 (should be in 26)
filter method 43 (should be in 27)
interlace method 44 (should be in 28)
IHDR CRC 45-48 (should be in 29-32)
...

这篇关于这个PNG文件有什么特别之处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆