From 0deaf0fa447c3fb0b6645f69c2ac9d48d0868409 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 8 Oct 2013 15:02:33 +0200 Subject: [PATCH] only print GIF_DISPOSE_WARNING once Change-Id: Iece235a6ee767cc2e3866bb6c9bb1d56d9a9ffb9 --- examples/gif2webp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/gif2webp.c b/examples/gif2webp.c index cc44480e..bfe128a2 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -475,7 +475,11 @@ int main(int argc, const char *argv[]) { if (data[0] != 4) goto End; frame.duration = delay * 10; // Duration is in 1 ms units for WebP. if (dispose == 3) { - fprintf(stderr, "WARNING: GIF_DISPOSE_RESTORE not supported."); + static int warning_printed = 0; + if (!warning_printed) { + fprintf(stderr, "WARNING: GIF_DISPOSE_RESTORE unsupported.\n"); + warning_printed = 1; + } // failsafe. TODO(urvang): emulate the correct behaviour by // recoding the whole frame. frame.dispose_method = WEBP_MUX_DISPOSE_BACKGROUND; @@ -489,7 +493,7 @@ int main(int argc, const char *argv[]) { if (!GetBackgroundColor(gif->SColorMap, gif->SBackGroundColor, &anim.bgcolor)) { fprintf(stderr, "GIF decode warning: invalid background color " - "index. Assuming white background.\n"); + "index. Assuming white background.\n"); } WebPUtilClearPic(&curr_frame, NULL); WebPUtilClearPic(&prev_canvas, NULL);