iOS 7是否改变了PNG兼容性/处理? [英] Has iOS 7 changed PNG compatibility/handling?

查看:87
本文介绍了iOS 7是否改变了PNG兼容性/处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 UIWebView 的应用程序,并且所有内容都在(现在仍然)在iOS 6上完美运行。但是,在iOS 7上,它有时会当我尝试加载某些PNG文件时,(这一个)。

I've got an app that uses a UIWebView, and everything was (and still is) working perfectly on iOS 6. On iOS 7, though, it is sometimes kicking back an error ImageIO: PNG not a PNG file when I try to load certain PNG files, (for example this one).

现在,很明显PNG文件没有损坏,因为它们可以在iOS 6上运行,而且它们有时甚至可以在iOS 7上运行,但有时它们会回复该错误。我找不到任何确定错误何时发生的常见原因,并且我没有做任何与它们有关的事情可能会解释它:除了在UIWebView中加载页面之外,我的代码不会触及它们,所以它似乎是WebView在内部做的事情。当然,这使得更难确定。

Now, obviously the PNG files aren't corrupted because they work on iOS 6 and they sometimes work even on iOS 7, but then sometimes they kick back that error. I can't find any common cause that determines when the error happens, and I'm not doing anything unusual with them that might account for it: my code doesn't touch them other than to load the page in the UIWebView, so it seems to be something that the WebView is doing internally. This, of course, makes it even harder to pin down.

我知道这是一个奇怪的问题,有点像问福特是否改变了轮子的工作方式,但是 Apple改变了iOS 7中处理PNG的方式吗?有人能想到可能导致这个iOS 7特定错误的原因吗?

I know this is a weird question, kind of like asking "did Ford change how wheels work", but did Apple change how it handles PNGs in iOS 7? Can anyone think of what might account for this iOS 7-specific error?

推荐答案

使用PNG文件本身解决问题:有人在Photoshop中打开某些文件进行编辑,这些文件在某些​​条件下无法正常工作。我不确切地知道它们在引擎盖下是什么让它们对应用程序不可接受,但是当我们重新导出它们时,它们完美地工作。奇怪,但已经解决了。

Turns out the problem WAS with the PNG files themselves: someone had opened certain ones in Photoshop to make edits, and those files weren't working under certain conditions. I don't know exactly what it was about them, under the hood, that made them unacceptable to the app, but when we re-exported them, they worked perfectly. Strange, but solved.

建议任何阅读此问题的人都有类似的问题:如果需要,可以在各种设置和条件下重新导出文件,看看是否他们开始工作了。

Recommendation for anyone reading this with a similar issue: re-export your files, under a variety of settings and conditions if need be, and see if they start working.

这篇关于iOS 7是否改变了PNG兼容性/处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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