Xcode 6 (beta 3): Unsupported pixel format in CSI

2019-02-11 12:17发布

When loading UIImages with png images in Xcode 6 beta 3 in Swift as follows:

    PipsImg = (UIImage(named: "Die-1"))

or

    PipsImg = [(UIImage(named: "Die-1")),(UIImage(named: "Die-2"))]

from associated images stored in the Images.xcassets folder, I receive the following fatal runtime errors:

 SimpleAnimation[680:60b] Unsupported pixel format in CSI
 SimpleAnimation[680:60b] Unable to create unsliced image from csi bitmap data.

this appears to be resolved in beta 4, however will leave in place for a bit as sometimes these regress

5条回答
聊天终结者
2楼-- · 2019-02-11 12:44

XCode 6.0.1 still have this problem. If you add .jpg to Images.xcassets and try to install app to the iOS 7 device.

To fix it just convert .jpg to .png

查看更多
小情绪 Triste *
3楼-- · 2019-02-11 12:50

I solved this problem via:

  1. Run iOS Simulator
  2. Reset content and settings via "iOS Simulator > Reset Content and Settings" menu.
  3. It works.
查看更多
Evening l夕情丶
4楼-- · 2019-02-11 13:00

Apple engineer's response:

The issue is that iOS 7 apps cannot have JPEG images in the CAR file. actool should have copied the JPEG as a loose image into your app's folder. To work around this issue, you should either convert the image to a PNG or include the JPEG as a resource outside of the asset catalog.

查看更多
叼着烟拽天下
5楼-- · 2019-02-11 13:05

In Xcode we now have a possibility to do a slicing for the image resources. If slicing is added the corresponding json for an image in asset catalog gets resizing info. This may look for example like this

"resizing" : {
    "mode" : "3-part-vertical",
    "center" : {
      "mode" : "fill",
      "height" : 6
    },
    "capInsets" : {
      "top" : 16,
      "bottom" : 6
    }
  }

iOS 7.0 doesn't handle slicing properly. So removing the slicing info from json may help to fix the problem (in my case that was a solution).

查看更多
孤傲高冷的网名
6楼-- · 2019-02-11 13:08

This is caused by a bug in Xcode 6 (beta 3 at this time). It appears to occur only if your build target is iOS 7.x

To work around this issue:

1) delete the files from the Images.xcassets container.

2) place the images directly into the "Supporting Files" folder.

Note: It is not required to add the ".png" extension within your code, making this a clean workaround.

Please create a RADAR (bug report) to Apple.

查看更多
登录 后发表回答