X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/d1d6801eb4badab97416d0b6294e1920d0f90c3e..acaf905b1130aae80fa59d2c861ffd4c8eb75486:/src/nsimage.m diff --git a/src/nsimage.m b/src/nsimage.m index a42950d1f5..82a176975f 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -1,5 +1,5 @@ /* Image support for the NeXT/Open/GNUstep and MacOSX window system. - Copyright (C) 1989, 1992, 1993, 1994, 2005, 2006, 2008, 2009, 2010 + Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -189,7 +189,11 @@ static EmacsImage *ImageList = nil; image = [[EmacsImage alloc] initByReferencingFile: [NSString stringWithUTF8String: SDATA (found)]]; +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; +#else imgRep = [image bestRepresentationForDevice: nil]; +#endif if (imgRep == nil) { [image release]; @@ -336,7 +340,7 @@ static EmacsImage *ImageList = nil; NSColor *rgbColor; if (bmRep == nil || color == nil) - return; + return self; if ([color colorSpaceName] != NSCalibratedRGBColorSpace) rgbColor = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; @@ -361,6 +365,8 @@ static EmacsImage *ImageList = nil; planes[2][i] = bb; } } + + return self; } @@ -497,4 +503,3 @@ static EmacsImage *ImageList = nil; @end -// arch-tag: 6b310280-6892-4e5e-8f34-41c4d384874f