From 1af51ab88b56179d74d8a7d6293346bf11e058d3 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 6 Oct 2008 12:55:28 +0000 Subject: [PATCH] made AddImage work without jpeglib, too --- lib/modules/swfbits.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 0749e0b..72e65af 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -1185,6 +1185,7 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali swf_SetU16(tag1, bitid); swf_SetLosslessImage(tag1, mem, width, height); +#if defined(HAVE_JPEGLIB) /* try jpeg image */ if(has_alpha) { tag2 = swf_InsertTag(0, ST_DEFINEBITSJPEG3); @@ -1195,8 +1196,9 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali swf_SetU16(tag2, bitid); swf_SetJPEGBits2(tag2, width, height, mem, quality); } +#endif - if(quality>100 || (tag1 && tag1->len < tag2->len)) { + if(quality>100 || !tag2 || (tag1 && tag1->len < tag2->len)) { /* use the zlib version- it's smaller */ tag1->prev = tag; if(tag) tag->next = tag1; -- 1.7.10.4