Merge pull request #115 from InScopeApps/master
Adding code to set the responseImage to the correct size.
This commit is contained in:
commit
60cef780c1
1 changed files with 5 additions and 1 deletions
|
|
@ -212,7 +212,11 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
|||
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
- (NSImage *)responseImage {
|
||||
if (!_responseImage && [self isFinished]) {
|
||||
self.responseImage = [[[NSImage alloc] initWithData:self.responseData] autorelease];
|
||||
// Ensure that the image is set to it's correct pixel width and height
|
||||
NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:self.responseData];
|
||||
self.responseImage = [[[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])] autorelease];
|
||||
[self.responseImage addRepresentation:bitimage];
|
||||
[bitimage release];
|
||||
}
|
||||
|
||||
return _responseImage;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue