views:

62

answers:

0

I'm trying to get my iPhone to convert some TIFs that it is downloading. They are from sources I can't control so I just have to deal with what ever gets thrown my way. I have multiple sources at the moment and only one is handled correctly. Because they are so large I am cutting them into 1024x1024 pngs and that appears to work fine with all sources. But after that I want to cut these PNGs into useable tiles and from one set I get the correct result, from the others I get this message (using Trevor Harmon's UIImage extensions)

CGBitmapContextCreate: unsupported parameter combination: 0 integer bits/component; 0 bits/pixel; 0-component colorspace; kCGImageAlphaNone; 0 bytes/row.

The PNGs in the mid-step are UIImages passed through UIImagePNGRepresentation and saved to disk. The ones created by the simulator look fine and the only difference I can see in Preview is that the ones that can't be cut into tiles has "Is Indexed 1" in the Info window and the ones that can be tiled do not.

So, what I'd like to know is if there is any other way to save a UIImage as a PNG so that I can guarantee every one I make will be able to be tiled.

*by 'tiling' I mean cut into equal sized images and saved again as PNGs