Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SKBitmap.ColorSpace is always null. Unable to check for CMYK, RGB, etc. #2849

Open
1 task done
dsyno opened this issue Apr 27, 2024 · 1 comment
Open
1 task done
Labels

Comments

@dsyno
Copy link

dsyno commented Apr 27, 2024

Description

Our code needs to check whether an image is CMYK or RGB (and reject any image that is CMYK).

However, @mattleibow "explicitly set the color space to null for backwards compatibility". That is breaking things, since it now seems to be impossible (without jumping through major hoops) to check whether an image is CMYK or not.

Solution: Allow ColorSpace to return the correct value. Or provide another method for checking the color space.

Code

SKBitmap.ColorSpace

Expected Behavior

SKBitmap.ColorSpace should return correct value, instead of null.

Actual Behavior

SKBitmap.ColorSpace always returns null.

Version of SkiaSharp

2.88.3 (Current)

Last Known Good Version of SkiaSharp

Other (Please indicate in the description)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

All

Platform / Operating System Version

All

Devices

All

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dsyno dsyno added the type/bug label Apr 27, 2024
@mattleibow
Copy link
Contributor

We could remove that for 3.0.

You could use SKImage as well - or use SKCodec directly and SKBitmap.Decode. That will not remove the colorspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants