mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 23:50:37 +00:00
Update behavior of initWithBitmapDataPlanes:... to match documentation and return nil if it cannot initialize given the existing data
This commit is contained in:
parent
2214368e53
commit
19426c573d
2 changed files with 10 additions and 3 deletions
|
@ -439,10 +439,11 @@
|
|||
{
|
||||
NSDebugLLog(@"NSImage", @"Creating bitmap image with pw %d ph %d bps %d spp %d alpha %d, planar %d cs %@",
|
||||
(int)width,(int) height, (int)bps, (int)spp, alpha, isPlanar, colorSpaceName);
|
||||
if (!bps || !spp || !width || !height)
|
||||
if (!bps || !spp || !width || !height)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Required arguments not specified creating NSBitmapImageRep"];
|
||||
// Per Apple documentation, return nil if can't initialize.
|
||||
NSLog(@"Cannot initialize image with bps = %ld, spp = %ld, width = %ld, height = %ld", bps, spp, width, height);
|
||||
return nil;
|
||||
}
|
||||
|
||||
_pixelsWide = width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue