: ImageIO: PNG invalid PNG file: extra chunks between iDOT and IDAT

后端 未结 4 791
囚心锁ツ
囚心锁ツ 2021-01-11 19:44

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

There is probably an invalid name of an image somewhere, but I am not sure what extra chunks b

相关标签:
4条回答
  • 2021-01-11 20:14

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

    1. My image is called "back2@2x.png"
    2. I renamed it to "back2.png"
    3. Ran the project (the image will appear stretched)
    4. Changed it back to "back2@2x.png"
    5. Ran project
    6. FIXED?!

    Good-luck hope it helps!

    0 讨论(0)
  • 2021-01-11 20:26

    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.

    0 讨论(0)
  • 2021-01-11 20:31

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

    Keyboard shortcut - Shift+Option+Command+K

    0 讨论(0)
  • 2021-01-11 20:31

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

    0 讨论(0)
提交回复
热议问题