From 4c9c6fb75c6d4eaab6fef30e9894b1bef203be6d Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 20 Apr 2009 23:57:08 +0000 Subject: [PATCH] Make sure that the gdiplus codec initialises GdiPlus before any library calls are made. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3419 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/codec/gdiplus.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pipi/codec/gdiplus.cpp b/pipi/codec/gdiplus.cpp index efd0460..f6c7d56 100755 --- a/pipi/codec/gdiplus.cpp +++ b/pipi/codec/gdiplus.cpp @@ -81,6 +81,10 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) { + ULONG_PTR token; + Gdiplus::GdiplusStartupInput input; + Gdiplus::GdiplusStartup(&token, &input, NULL); + wchar_t const *fmt; if(strstr(name, ".gif")) fmt = L"image/gif"; @@ -121,10 +125,6 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) return -1; } - ULONG_PTR token; - Gdiplus::GdiplusStartupInput input; - Gdiplus::GdiplusStartup(&token, &input, NULL); - Gdiplus::Bitmap *b = new Gdiplus::Bitmap(img->w, img->h, PixelFormat32bppARGB);