diff --git a/ChangeLog b/ChangeLog index 00936de5b2..69cbb4cc39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Mar 30 20:50:21 BST 1999 Adam D. Moss + + * plug-ins/gif/gif.c: + 3.00.01 - Round image timing to nearest 10ms instead of + truncating. Insert a mandatory 10ms minimum delay + for the frames of looping animated GIFs, to avoid + generating an evil CPU-sucking animation that 'other' + GIF-animators sometimes like to save. + Mon Mar 29 19:05:03 PST 1999 Manish Singh * Made 1.1.4 release diff --git a/plug-ins/common/gif.c b/plug-ins/common/gif.c index 3afe826e73..ae27b18ce3 100644 --- a/plug-ins/common/gif.c +++ b/plug-ins/common/gif.c @@ -7,7 +7,7 @@ * Based around original GIF code by David Koblas. * * - * Version 3.0.0 - 99/03/20 + * Version 3.0.1 - 99/03/30 * Adam D. Moss - */ /* @@ -23,6 +23,13 @@ /* * REVISION HISTORY * + * 99/03/30 + * 3.00.01 - Round image timing to nearest 10ms instead of + * truncating. Insert a mandatory 10ms minimum delay + * for the frames of looping animated GIFs, to avoid + * generating an evil CPU-sucking animation that 'other' + * GIF-animators sometimes like to save. + * * 99/03/20 * 3.00.00 - GIF-loading code moved to separate plugin. * @@ -1058,9 +1065,25 @@ save_image (char *filename, g_free(layer_name); if (Delay89 < 0) - Delay89 = gsvals.default_delay/10; + Delay89 = (gsvals.default_delay + 5) / 10; else - Delay89 /= 10; + Delay89 = (Delay89 + 5) / 10; + + /* don't allow a CPU-sucking completely 0-delay looping anim */ + if ((nlayers > 1) && + gsvals.loop && + (Delay89 == 0)) + { + static gboolean onceonly = FALSE; + + if (!onceonly) + { + g_warning("GIF plugin: Delay inserted to prevent evil " + "CPU-sucking anim.\n"); + onceonly = TRUE; + } + Delay89 = 1; + } GIFEncodeGraphicControlExt (outfile, Disposal, Delay89, nlayers, cols, rows, 0, diff --git a/plug-ins/gif/gif.c b/plug-ins/gif/gif.c index 3afe826e73..ae27b18ce3 100644 --- a/plug-ins/gif/gif.c +++ b/plug-ins/gif/gif.c @@ -7,7 +7,7 @@ * Based around original GIF code by David Koblas. * * - * Version 3.0.0 - 99/03/20 + * Version 3.0.1 - 99/03/30 * Adam D. Moss - */ /* @@ -23,6 +23,13 @@ /* * REVISION HISTORY * + * 99/03/30 + * 3.00.01 - Round image timing to nearest 10ms instead of + * truncating. Insert a mandatory 10ms minimum delay + * for the frames of looping animated GIFs, to avoid + * generating an evil CPU-sucking animation that 'other' + * GIF-animators sometimes like to save. + * * 99/03/20 * 3.00.00 - GIF-loading code moved to separate plugin. * @@ -1058,9 +1065,25 @@ save_image (char *filename, g_free(layer_name); if (Delay89 < 0) - Delay89 = gsvals.default_delay/10; + Delay89 = (gsvals.default_delay + 5) / 10; else - Delay89 /= 10; + Delay89 = (Delay89 + 5) / 10; + + /* don't allow a CPU-sucking completely 0-delay looping anim */ + if ((nlayers > 1) && + gsvals.loop && + (Delay89 == 0)) + { + static gboolean onceonly = FALSE; + + if (!onceonly) + { + g_warning("GIF plugin: Delay inserted to prevent evil " + "CPU-sucking anim.\n"); + onceonly = TRUE; + } + Delay89 = 1; + } GIFEncodeGraphicControlExt (outfile, Disposal, Delay89, nlayers, cols, rows, 0,