Bug 4573 - Missing method CGColorSpaceGetColorTable
Summary: Missing method CGColorSpaceGetColorTable
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
Depends on:
Reported: 2012-04-20 16:47 UTC by Nathan Curtis
Modified: 2012-05-10 22:44 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

An indexed PNG we recolor at runtime. (9.92 KB, image/png)
2012-04-20 16:47 UTC, Nathan Curtis

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Nathan Curtis 2012-04-20 16:47:35 UTC
Created attachment 1719 [details]
An indexed PNG we recolor at runtime.

In order to get at the palette for an indexed PNG image, I need access to CGColorSpaceGetColorTable. More information on what I'm trying to do here: http://stackoverflow.com/questions/10220240/how-do-i-modify-the-palette-of-an-indexed-png-at-runtime-on-ios. This is for an established image recoloring system used for a game I'm working on porting to iOS.
Comment 1 Sebastien Pouliot 2012-04-20 16:59:41 UTC
Thanks for your report - and the image!

The missing call was already added in 264efaacfc958b863ed98e2b49f166b8ec7e76ed and you can see the pinvoke declaration from github [1].

I'll be adding a new test case (to our internal test suite) that use your image as it will be better than the "API roundtrip" we presently have.

[1] https://github.com/mono/maccore/commit/e9fd100d474522c1973c56a4a30d026f52f89ab9
Comment 2 Nathan Curtis 2012-04-20 17:00:48 UTC
Great, thanks!
Comment 3 Sebastien Pouliot 2012-05-10 22:44:57 UTC
$ file tests/monotouch-test/behind_back.png 
tests/monotouch-test/behind_back.png: PNG image data, 100 x 1280, 8-bit colormap, non-interlaced

^ even if indexed it turns out UIImage and CGImage.FromPng both returns RGB images. It seems it's the case when an alpha channel is present (according to the comments on the stackoverflow link I provided on my answer to your question).

I'll try to find another one, maybe from http://www.schaik.com/pngsuite/ to cover this case properly (even if our tests are probably ok as-is).

Still thank you for the image and filling the issue :-)