xcode <错误>:ImageIO:PNG 无效的 PNG 文件:iDOT 和 IDAT 之间的额外块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33052270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:01:42  来源:igfitidea点击:

<Error>: ImageIO: PNG invalid PNG file: extra chunks between iDOT and IDAT

iosxcode

提问by potato

Just got this funny looking error in my swift project debugger.

刚刚在我的 swift 项目调试器中遇到了这个看起来很有趣的错误。

There is probably an invalid name of an image somewhere, but I am not sure what extra chunks between iDOT and IDATmean.

某处可能有一个无效的图像名称,但我不确定是什么extra chunks between iDOT and IDAT意思。

Do you have any idea what causes it?

你知道是什么原因造成的吗?

采纳答案by brilliantairic

This issue is completely random and happened to me too with a few images. Probably another Xcode bug.

这个问题是完全随机的,我也遇到了一些图像。可能是另一个 Xcode 错误。

  1. My image is called "[email protected]"
  2. I renamed it to "back2.png"
  3. Ran the project (the image will appear stretched)
  4. Changed it back to "[email protected]"
  5. Ran project
  6. FIXED?!
  1. 我的图像被称为“[email protected]
  2. 我将它重命名为“back2.png”
  3. 运行项目(图像将出现拉伸)
  4. 把它改回“[email protected]
  5. 冉项目
  6. 固定的?!

Good-luck hope it helps!

祝你好运希望它有帮助!

回答by Stefan S

Product > Clean Build Folder (with pressed Option)fixed it for me

产品 > 清理构建文件夹(按下选项)为我修复了它

Keyboard shortcut - Shift+Option+Command+K

键盘快捷键 - Shift+Option+Command+K

回答by flame3

In XCode 8, I cleaned the project (Product->Clean). Then quit XCode. Open it again. Then it works. I haven't changed name of the image. I guess it is just because XCode has some problem. Nothing is wrong with your code.

在 XCode 8 中,我清理了项目(Product->Clean)。然后退出 XCode。再打开。然后它起作用了。我没有更改图像的名称。我想这只是因为 XCode 有一些问题。您的代码没有任何问题。

回答by Genevios

I just delete all images which have problem to appear and after load again the same images and work perfectly.

我只是删除所有出现问题的图像,然后再次加载相同的图像并完美运行。