Image improvements.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2000-04-18 16:58:14 +00:00
parent a51fd0ad14
commit b9de76dad5
5 changed files with 103 additions and 16 deletions

View file

@ -82,23 +82,32 @@ static NSMutableArray* imageReps = NULL;
// FIXME: Should this be an exception? Should we even check this?
if (!ext)
{
NSLog(@"extension missing from filename - '%@'", filename);
NSLog(@"Extension missing from filename - '%@'", filename);
return nil;
}
array = [NSMutableArray arrayWithCapacity: 1];
array = nil;
count = [imageReps count];
for (i = 0; i < count; i++)
{
Class rep = [imageReps objectAtIndex: i];
if ([[rep imageFileTypes] indexOfObject: ext] != NSNotFound)
{
NSData* data = [NSData dataWithContentsOfFile: filename];
NSData* data;
if ([rep respondsToSelector: @selector(imageRepsWithFile:)])
array = [rep imageRepsWithFile: filename];
if ([array count] > 0)
break;
data = [NSData dataWithContentsOfFile: filename];
if ([rep respondsToSelector: @selector(imageRepsWithData:)])
[array addObjectsFromArray: [rep imageRepsWithData: data]];
array = [rep imageRepsWithData: data];
else if ([rep respondsToSelector: @selector(imageRepWithData:)])
[array addObject: [rep imageRepWithData: data]];
array = [rep imageRepWithData: data];
if ([array count] > 0)
break;
}
}
return (NSArray *)array;