Xcode 6 (beta 3): Unsupported pixel format in CSI or Unable to create unsliced image from csi bitmap data
Asked Answered
Z

5

24

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

Zero answered 9/7, 2014 at 1:4 Comment(7)
Those aren't fatal errors, the program keeps running, although those images don't get displayed.Definiens
@MatthiasBauch - questions about beta software are still worth answering, who knows if or when it will be fixed or become obsolete (see discussion on meta)Definiens
Makes sense. I'll keep it in mind. ThanksInkblot
I still got the bug in 6.1 ...Rushton
I still got the bug in 6.2 ...Kulda
I sent a bug report to Apple; waiting for a responseSpikes
Possible duplicate of Can't change UITabBarItem.image: Unsupported pixel format in CSICommingle
Z
35

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.

Zero answered 9/7, 2014 at 1:4 Comment(10)
If you continue to get the same errors as the original post then you need to go to your Organizer (under the Window menu) and delete the derived data.Polder
This is ridiculous, messes up the projects. I'll just wait for the next Beta.Incriminate
This bug seems to be fixed in beta 4Corunna
I'm currently running beta 5 and just ran into this issue again. It would also appear that the workaround does not work for me either. Anyone have a Radar id I can reference when I file my own?Sabulous
Xcode 6.1.1 and iPad running iOS7.1 suffers from this also.Arctogaea
Xcode 6.1.1 and iPod running iOS7.x suffers from this also.Gearhart
Yes you are right @DaRk-_-D0G it seems image.xcassests having problem with JPG extension.Warrior
@Kamarshad image.xcassests just give PNG, TiffFormicary
Actully I am using Xcode 6.1.1 with iPhone 5C running iOS 7.0.5 and its crashing so It may not just be relatedWarrior
I'm in Xcode 7.1. This works building for iOS 9, but fails building for iOS 8.Shunt
D
23

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

Doubs answered 19/9, 2014 at 3:29 Comment(1)
XCode 6.1 also has it but when I converted jpg to png there was no problem. Always using png on xcassets and I accidentally included 2 jpg files and had this issue. It definitely is an issue of xcassets with jpg files.Stodgy
S
17

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.

Sheeb answered 23/3, 2015 at 5:3 Comment(0)
J
0

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.
Jsandye answered 25/9, 2014 at 8:15 Comment(0)
M
0

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).

Mccorkle answered 2/10, 2014 at 12:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.