- If no type is specified and an image fails to load as the type its extension would suggest,
we will now attempt to load it as one of the other image formats we support.
char ext[MAX_EXTENSION];
subclass(BitmapFormat) format;
int typeToTry = -1;
+ char * guessedType = type;
if(!fileName) return false;
- if(!type)
+ if(!guessedType)
{
- type = GetExtension(fileName, ext);
- strlwr(type);
+ guessedType = GetExtension(fileName, ext);
+ strlwr(guessedType);
}
- if(type)
- format = FindFormat(type);
+ if(guessedType)
+ format = FindFormat(guessedType);
if(!format)
typeToTry = 0;
delete f;
}
}
- if(typeToTry == -1) break;
+ if(typeToTry == -1)
+ {
+ if(type) break;
+ typeToTry = 0;
+ }
}
if(!result)