From 1c2a8015f9ee0f64928eee4bfab2b25e5331c6eb Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 17 Dec 2002 16:26:34 +0000 Subject: [PATCH] merged fix for #71409 from stable branch. 2002-12-17 Sven Neumann * app/main.c: merged fix for #71409 from stable branch. * plug-ins/common/jpeg.c: merged fix for #75398 from stable branch. --- ChangeLog | 8 +++++++- app/main.c | 12 +++++++++--- plug-ins/common/jpeg.c | 36 ++++-------------------------------- plug-ins/jpeg/jpeg-load.c | 36 ++++-------------------------------- plug-ins/jpeg/jpeg-load.h | 36 ++++-------------------------------- plug-ins/jpeg/jpeg-save.c | 36 ++++-------------------------------- plug-ins/jpeg/jpeg-save.h | 36 ++++-------------------------------- plug-ins/jpeg/jpeg.c | 36 ++++-------------------------------- plug-ins/jpeg/jpeg.h | 36 ++++-------------------------------- 9 files changed, 44 insertions(+), 228 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5efc653f71..22d1236c63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-12-17 Sven Neumann + + * app/main.c: merged fix for #71409 from stable branch. + + * plug-ins/common/jpeg.c: merged fix for #75398 from stable branch. + 2002-12-17 Michael Natterer * app/tools/gimptransformtool.c @@ -32,7 +38,7 @@ simulate the vision of people with color-deficiency to address bug #101256. Didn't know any scientific name or any correct formula, so I just added the framework plus the approximation formula from - the bug report. Will need some more work to become usable. + the bug report. Will need some more work to become useable. 2002-12-16 Sven Neumann diff --git a/app/main.c b/app/main.c index 65ff5f9ecc..eac2f25aff 100644 --- a/app/main.c +++ b/app/main.c @@ -439,14 +439,20 @@ main (int argc, /* Handle fatal signals */ + /* these are handled by gimp_terminate() */ gimp_signal_private (SIGHUP, gimp_sigfatal_handler, 0); gimp_signal_private (SIGINT, gimp_sigfatal_handler, 0); gimp_signal_private (SIGQUIT, gimp_sigfatal_handler, 0); gimp_signal_private (SIGABRT, gimp_sigfatal_handler, 0); - gimp_signal_private (SIGBUS, gimp_sigfatal_handler, 0); - gimp_signal_private (SIGSEGV, gimp_sigfatal_handler, 0); gimp_signal_private (SIGTERM, gimp_sigfatal_handler, 0); - gimp_signal_private (SIGFPE, gimp_sigfatal_handler, 0); + + if (stack_trace_mode != STACK_TRACE_NEVER) + { + /* these are handled by gimp_fatal_error() */ + gimp_signal_private (SIGBUS, gimp_sigfatal_handler, 0); + gimp_signal_private (SIGSEGV, gimp_sigfatal_handler, 0); + gimp_signal_private (SIGFPE, gimp_sigfatal_handler, 0); + } /* Ignore SIGPIPE because plug_in.c handles broken pipes */ diff --git a/plug-ins/common/jpeg.c b/plug-ins/common/jpeg.c index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/common/jpeg.c +++ b/plug-ins/common/jpeg.c @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg-load.c b/plug-ins/jpeg/jpeg-load.c index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg-load.c +++ b/plug-ins/jpeg/jpeg-load.c @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg-load.h b/plug-ins/jpeg/jpeg-load.h index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg-load.h +++ b/plug-ins/jpeg/jpeg-load.h @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg-save.c b/plug-ins/jpeg/jpeg-save.c index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg-save.c +++ b/plug-ins/jpeg/jpeg-save.c @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg-save.h b/plug-ins/jpeg/jpeg-save.h index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg-save.h +++ b/plug-ins/jpeg/jpeg-save.h @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg.c b/plug-ins/jpeg/jpeg.c index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg.c +++ b/plug-ins/jpeg/jpeg.c @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID; diff --git a/plug-ins/jpeg/jpeg.h b/plug-ins/jpeg/jpeg.h index de4b39ebce..1f480f1e2c 100644 --- a/plug-ins/jpeg/jpeg.h +++ b/plug-ins/jpeg/jpeg.h @@ -712,9 +712,7 @@ load_image (gchar *filename, gint scanlines; gint i, start, end; - JpegSaveVals local_save_vals; GimpParasite * volatile comment_parasite = NULL; - GimpParasite * volatile vals_parasite = NULL; /* We set up the normal JPEG error routines. */ cinfo.err = jpeg_std_error (&jerr.pub); @@ -786,29 +784,9 @@ load_image (gchar *filename, comment_parasite = NULL; } - /* pw - figuring out what the saved values were is non-trivial. - * They don't seem to be in the cinfo structure. For now, I will - * just use the defaults, but if someone figures out how to derive - * them this is the place to store them. */ - - local_save_vals.quality = DEFAULT_QUALITY; - local_save_vals.smoothing = DEFAULT_SMOOTHING; - local_save_vals.optimize = DEFAULT_OPTIMIZE; - -#ifdef HAVE_PROGRESSIVE_JPEG - local_save_vals.progressive = cinfo.progressive_mode; -#else - local_save_vals.progressive = 0; -#endif /* HAVE_PROGRESSIVE_JPEG */ - local_save_vals.baseline = DEFAULT_BASELINE; - local_save_vals.subsmp = DEFAULT_SUBSMP; /* sg - this _is_ there, but I'm too lazy */ - local_save_vals.restart = DEFAULT_RESTART; - local_save_vals.dct = DEFAULT_DCT; - local_save_vals.preview = DEFAULT_PREVIEW; - - vals_parasite = gimp_parasite_new ("jpeg-save-options", 0, - sizeof (local_save_vals), - &local_save_vals); + /* Do not attach the "jpeg-save-options" parasite to the image + * because this conflics with the global defaults. See bug #75398: + * http://bugzilla.gnome.org/show_bug.cgi?id=75398 */ } /* Step 4: set parameters for decompression */ @@ -1061,19 +1039,13 @@ load_image (gchar *filename, /* pw - Last of all, attach the parasites (couldn't do it earlier - there was no image. */ - if (!preview) + if (!preview) { if (comment_parasite) { gimp_image_parasite_attach (image_ID, comment_parasite); gimp_parasite_free (comment_parasite); } - - if (vals_parasite) - { - gimp_image_parasite_attach (image_ID, vals_parasite); - gimp_parasite_free (vals_parasite); - } } return image_ID;