mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:40:48 +00:00
Deal with images taht result in no data. This happens in themes that
have to small images to be split up into 9 tiles. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34688 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b1db7ee743
commit
05514b6ac5
3 changed files with 21 additions and 7 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2012-02-01 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSBitmapImageRep.m (-initWithFocusedViewRect:): Return
|
||||||
|
nil if the image data is empty. This could lead to an exception
|
||||||
|
alter on.
|
||||||
|
* Source/NSImage.m (-TIFFRepresentationUsingCompression:factor:,
|
||||||
|
-TIFFRepresentation): Deal with -initWithFocusedViewRect: returning nil.
|
||||||
|
|
||||||
2012-02-01 Fred Kiefer <FredKiefer@gmx.de>
|
2012-02-01 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSMenu.m (-setMain:): Rearrange code to avoid duplicate
|
* Source/NSMenu.m (-setMain:): Rearrange code to avoid duplicate
|
||||||
|
|
|
@ -345,7 +345,7 @@
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
_imageData = RETAIN([dict objectForKey: @"Data"]);
|
_imageData = RETAIN([dict objectForKey: @"Data"]);
|
||||||
if (_imageData == nil)
|
if (_imageData == nil || [_imageData length] == 0)
|
||||||
{
|
{
|
||||||
NSLog(@"NSBitmapImageRep initWithFocusedViewRect: failed");
|
NSLog(@"NSBitmapImageRep initWithFocusedViewRect: failed");
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
|
|
@ -1491,9 +1491,12 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
|
||||||
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:
|
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:
|
||||||
NSMakeRect(0.0, 0.0, size.width, size.height)];
|
NSMakeRect(0.0, 0.0, size.width, size.height)];
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
[self addRepresentation: rep];
|
if (nil != rep)
|
||||||
data = [rep TIFFRepresentation];
|
{
|
||||||
RELEASE(rep);
|
[self addRepresentation: rep];
|
||||||
|
data = [rep TIFFRepresentation];
|
||||||
|
RELEASE(rep);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -1519,9 +1522,12 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
|
||||||
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:
|
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:
|
||||||
NSMakeRect(0.0, 0.0, size.width, size.height)];
|
NSMakeRect(0.0, 0.0, size.width, size.height)];
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
[self addRepresentation: rep];
|
if (nil != rep)
|
||||||
data = [rep TIFFRepresentationUsingCompression: comp factor: aFloat];
|
{
|
||||||
RELEASE(rep);
|
[self addRepresentation: rep];
|
||||||
|
data = [rep TIFFRepresentationUsingCompression: comp factor: aFloat];
|
||||||
|
RELEASE(rep);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue