Changeset 2013
- Timestamp:
- Oct 12, 2012, 7:00:44 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/image/codec/gdiplus-image.cpp
r1513 r2013 51 51 bool GdiPlusImageData::Open(char const *path) 52 52 { 53 Gdiplus::Status status; 54 ULONG_PTR token; 55 Gdiplus::GdiplusStartupInput input; 56 status = Gdiplus::GdiplusStartup(&token, &input, NULL); 57 if (status != Gdiplus::Ok) 58 { 59 #if !LOL_RELEASE 60 Log::Error("error %d while initialising GDI+\n", status); 61 #endif 62 return false; 63 } 64 53 65 size_t len; 54 66 len = mbstowcs(NULL, path, 0); … … 63 75 } 64 76 65 ULONG_PTR token; 66 Gdiplus::GdiplusStartupInput input; 67 Gdiplus::GdiplusStartup(&token, &input, NULL); 68 77 bitmap = NULL; 78 status = Gdiplus::Ok; 69 79 for (wchar_t const *wname = wpath; *wname; wname++) 70 if ((bitmap = Gdiplus::Bitmap::FromFile(wname, 0))) 71 break; 80 { 81 bitmap = Gdiplus::Bitmap::FromFile(wname, 0); 82 if (bitmap) 83 { 84 status = bitmap->GetLastStatus(); 85 if (status == Gdiplus::Ok) 86 break; 87 #if !LOL_RELEASE 88 if (status != Gdiplus::InvalidParameter) 89 Log::Error("error %d loading %s\n", status, path); 90 #endif 91 delete bitmap; 92 } 93 } 72 94 73 95 delete[] wpath; … … 77 99 Log::Error("could not load %s\n", path); 78 100 #endif 79 return false;80 }81 82 if (bitmap->GetLastStatus() != Gdiplus::Ok)83 {84 #if !LOL_RELEASE85 Log::Error("error %d loading %s\n",86 (unsigned)bitmap->GetLastStatus(), path);87 #endif88 delete bitmap;89 101 return false; 90 102 }
Note: See TracChangeset
for help on using the changeset viewer.