From 824ed35139bdb11f5fc38572ac23ee0b5a5f8663 Mon Sep 17 00:00:00 2001 From: konn Date: Fri, 18 Mar 2005 07:12:17 +0000 Subject: [PATCH] =?utf8?q?gdImageDestroy=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@13 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- src/mod_chxj.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod_chxj.c b/src/mod_chxj.c index 7044a75c..f71188ec 100644 --- a/src/mod_chxj.c +++ b/src/mod_chxj.c @@ -847,11 +847,12 @@ static int chxj_convert_images(request_rec *r) if (spec->color <= 256) { - gdImageTrueColorToPalette(im_out, 0, spec->color); + gdImageTrueColorToPalette(im_out, 1, spec->color); } else if (spec->color == 4096) { + gdImageTrueColorToPalette(im_out, 1, 256); } else if (spec->color == 65536) @@ -869,6 +870,8 @@ static int chxj_convert_images(request_rec *r) fout = fopen(tmpfile,"wb"); if (fout == NULL) { + gdImageDestroy(im_in); + gdImageDestroy(im_out); ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,"file open error.[%s]", tmpfile); return HTTP_INTERNAL_SERVER_ERROR; } @@ -900,6 +903,8 @@ static int chxj_convert_images(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,"convert to bmp(unsupported)"); } fclose(fout); + gdImageDestroy(im_in); + gdImageDestroy(im_out); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,"color=[%d]", spec->color); -- 2.11.0