Invalid PNG Image file: iDOT doesn't point to valid IDAT chunk

前端 未结 6 1896
北海茫月
北海茫月 2021-02-13 22:22

I have some HTML content pages in an app and I\'m using a UIWebView to display them. Some of these pages have a PNG image in them that is generating the following message in th

相关标签:
6条回答
  • 2021-02-13 22:32

    'cleaning' the project (xcode menu path : product -> clean) solved this exact issue for me.

    Resaving the .png with a new name did not.

    Image did appear in the simulator but not on the test device (ipod touch 5th gen.)

    Very large image 4000 x 4000

    0 讨论(0)
  • 2021-02-13 22:34

    I had the same problem with my app.It turn out that the images that the user was uploading to my server and edited with php +imagemagik where striped out.I was using the following command to edit the uploaded image:

    convert $uploadfile -resize 300x300 -quality 30 -strip $uploadfile
    

    When i removed the -strip parameter the error was disappeared !

    0 讨论(0)
  • 2021-02-13 22:35

    You may want to check you don't have another file with the same name in another directory. That is what caused this error for me .. (duplicate Default.png)

    0 讨论(0)
  • 2021-02-13 22:35

    Same problem here.
    1 - Close XCode;
    2 - Open the image in Photoshop;
    3 - Re-save ( replace the same image ) with 80% quality;
    4 - Open XCode, clean it CMD + SHIFT + K;
    5 - Build it in your device again;

    Very simple and work for me.
    And for you ?

    0 讨论(0)
  • 2021-02-13 22:51

    Had the same problem. Solution: use "color sync utility" which is a standard program, you can load from launchpad. Open the png file and save it with the utility.

    0 讨论(0)
  • 2021-02-13 22:54

    Strangely, I had the exact same issue just about an hour ago. I didn't find a particular reason for why it was failing, but I think I was able to "fix" the image to make it display properly and not throw an error.

    I just opened it in Preview and exported a new PNG file from the source. Once I replaced the bad image in my project file with the newly created one, I cleaned, compiled and it worked as expected.

    Hope it's as easy as that for you...

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