diff --git a/Source/NSImage.m b/Source/NSImage.m index 5d899314b..e6152ea16 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -849,6 +849,7 @@ static Class cacheClass = 0; /* * What's the best representation? FIXME * At the moment we take the last bitmap we find. + * If we can't find a bitmap, we take whatever we can! */ [_reps getObjects: reps]; for (i = 0; i < count; i++) @@ -859,6 +860,10 @@ static Class cacheClass = 0; { rep = repd->rep; } + else if (rep == nil) + { + rep = repd->rep; + } } } return rep; @@ -867,7 +872,7 @@ static Class cacheClass = 0; - (NSImageRep*) cacheForRep: (NSImageRep*)rep onDevice: (NSDictionary*)deviceDescription { - if (NSImageDoesCaching == YES) + if (NSImageDoesCaching == YES && [rep isKindOfClass: cacheClass] == NO) { NSImageRep *cacheRep = nil; unsigned count = [_reps count];