set the warning and error handlers after opening the file. We get two

2006-11-27  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff.c (load_image) (save_image): set the
	warning and error handlers after opening the file. We get two
	errors otherwise.
This commit is contained in:
Sven Neumann 2006-11-27 10:41:42 +00:00 committed by Sven Neumann
parent 5e43848a7c
commit 39ae3d177a
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2006-11-27 Sven Neumann <sven@gimp.org>
* plug-ins/common/tiff.c (load_image) (save_image): set the
warning and error handlers after opening the file. We get two
errors otherwise.
2006-11-27 Sven Neumann <sven@gimp.org>
* app/base/color-balance.c (color_balance_transfer_init): applied

View File

@ -474,6 +474,7 @@ tiff_warning(const gchar *module,
if (va_arg (ap_test, int) >= 32768)
return;
}
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, ap);
}
@ -536,17 +537,17 @@ load_image (const gchar *filename)
gimp_rgb_set (&color, 0.0, 0.0, 0.0);
TIFFSetWarningHandler (tiff_warning);
TIFFSetErrorHandler (tiff_error);
tif = TIFFOpen (filename, "r");
if (!tif)
if (! tif)
{
g_message (_("Could not open '%s' for reading: %s"),
gimp_filename_to_utf8 (filename), g_strerror (errno));
gimp_quit ();
}
TIFFSetWarningHandler (tiff_warning);
TIFFSetErrorHandler (tiff_error);
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
@ -2124,17 +2125,17 @@ save_image (const gchar *filename,
tile_height = gimp_tile_height ();
rowsperstrip = tile_height;
TIFFSetWarningHandler (tiff_warning);
TIFFSetErrorHandler (tiff_error);
tif = TIFFOpen (filename, "w");
if (!tif)
if (! tif)
{
g_message (_("Could not open '%s' for writing: %s"),
gimp_filename_to_utf8 (filename), g_strerror (errno));
return FALSE;
}
TIFFSetWarningHandler (tiff_warning);
TIFFSetErrorHandler (tiff_error);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));