Menu

#7 differentiate file open errors

open
nobody
None
5
2010-01-21
2010-01-21
Anonymous
No

--- RGBAImage.cpp 2009-05-22 14:27:14.000000000 -0700
+++ RGBAImage.cpp 2010-01-21 15:02:57.000000000 -0700
@@ -98,12 +98,17 @@
FIBITMAP* freeImage = 0;
if(FIBITMAP* temporary = FreeImage_Load(fileType, filename, 0))
{
+ if(!temporary)
+ {
+ printf( "Failed to load the image %s\n", filename);
+ return 0;
+ }
freeImage = FreeImage_ConvertTo32Bits(temporary);
FreeImage_Unload(temporary);
}
if(!freeImage)
{
- printf( "Failed to load the image %s\n", filename);
+ printf( "Failed to convert the image %s\n", filename);
return 0;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.