SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.14k
stars
522
forks
source link
[BUG] SKBitmap.ColorSpace is always null. Unable to check for CMYK, RGB, etc. #2849
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
[x] I agree to follow this project's Code of Conduct
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
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