#pragma .h #import <Foundation/NSObject.h>
#pragma .h #import <Foundation/NSString.h>
#pragma .h #import <AppKit/NSImage.h>

#import "NSObject.LoadImage.h"

@implementation NSObject(LoadImage)

+ (NSImage *)loadImageFromBundle:(NSString *)imageName
{
    id       image = nil;
    id       bundle = [NSBundle bundleForClass:self];
    NSString *path;
    if(path = [bundle pathForResource:imageName ofType:@"tiff"]) {
        image = [[NSImage alloc] initWithContentsOfFile:path];
        [image setName:imageName];
    }
    return image;
}

- (NSImage *)loadImageFromBundle:(NSString *)imageName
{
    return [[self class] loadImageFromBundle:(NSString *)imageName];
}

@end
