mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +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
|
@ -1,3 +1,9 @@
|
|||
2021-10-12 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSBitmapImageRep.m: Change initWithBitmapDataPlanes:...
|
||||
to conform to Apple documented behavior and return nil if it
|
||||
cannot initialize with the given arguments.
|
||||
|
||||
2021-10-03 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSComboBox.h: Add check to see if @optional
|
||||
|
|
|
@ -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…
Reference in a new issue