plug-ins: start the progress before opening files for loading/saving

so the user gets feedback as early as possible.
This commit is contained in:
Michael Natterer 2014-07-23 16:39:00 +02:00
parent 208c3ecd2a
commit f28878b6d3
30 changed files with 133 additions and 138 deletions

View File

@ -335,6 +335,8 @@ load_image (const gchar *file,
gint i, j, k; /* Counters */ gint i, j, k; /* Counters */
size_t n_read; /* Number of items read from file */ size_t n_read; /* Number of items read from file */
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (file));
/* Open the file for reading */ /* Open the file for reading */
fp = g_fopen (file, "r"); fp = g_fopen (file, "r");
@ -347,9 +349,6 @@ load_image (const gchar *file,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (file));
/* Get the image dimensions and create the image... */ /* Get the image dimensions and create the image... */
n_read = fread (header, 4, 1, fp); n_read = fread (header, 4, 1, fp);
@ -769,6 +768,9 @@ save_image (const gchar *file,
width = gegl_buffer_get_width (buffer); width = gegl_buffer_get_width (buffer);
height = gegl_buffer_get_height (buffer); height = gegl_buffer_get_height (buffer);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (file));
/* Open the file for writing */ /* Open the file for writing */
fp = g_fopen (file, "w"); fp = g_fopen (file, "w");
@ -780,9 +782,6 @@ save_image (const gchar *file,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (file));
/* Headers */ /* Headers */
memset (header, 0, 32); memset (header, 0, 32);
strcpy ((gchar *) header, "KiSS"); strcpy ((gchar *) header, "KiSS");

View File

@ -331,7 +331,9 @@ load_image (const gchar *filename,
gboolean is_signed = FALSE; gboolean is_signed = FALSE;
guint8 in_sequence = 0; guint8 in_sequence = 0;
/* open the file */ gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
DICOM = g_fopen (filename, "rb"); DICOM = g_fopen (filename, "rb");
if (! DICOM) if (! DICOM)
@ -342,9 +344,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* allocate the necessary structures */ /* allocate the necessary structures */
dicominfo = g_new0 (DicomInfo, 1); dicominfo = g_new0 (DicomInfo, 1);

View File

@ -345,13 +345,13 @@ load_image (GFile *file,
gsize size; gsize size;
gint i; gint i;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
input = G_INPUT_STREAM (g_file_read (file, NULL, error)); input = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (! input) if (! input)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
size = G_STRUCT_OFFSET (BrushHeader, magic_number); size = G_STRUCT_OFFSET (BrushHeader, magic_number);
if (! g_input_stream_read_all (input, &bh, size, if (! g_input_stream_read_all (input, &bh, size,
@ -671,13 +671,13 @@ save_image (GFile *file,
bpp = babl_format_get_bytes_per_pixel (format); bpp = babl_format_get_bytes_per_pixel (format);
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error)); output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error));
if (! output) if (! output)
return FALSE; return FALSE;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
buffer = gimp_drawable_get_buffer (drawable_ID); buffer = gimp_drawable_get_buffer (drawable_ID);
width = gimp_drawable_width (drawable_ID); width = gimp_drawable_width (drawable_ID);

View File

@ -348,6 +348,9 @@ load_image (const gchar *filename,
gchar version[4]; gchar version[4];
gint32 image_ID = -1; gint32 image_ID = -1;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fd = g_fopen (filename, "rb"); fd = g_fopen (filename, "rb");
if (! fd) if (! fd)
@ -358,9 +361,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
if (! ReadOK (fd, buf, 6)) if (! ReadOK (fd, buf, 6))
{ {
g_message ("Error reading magic number"); g_message ("Error reading magic number");

View File

@ -791,6 +791,11 @@ save_image (const gchar *filename,
} }
/* init the progress meter */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* open the destination file for writing */ /* open the destination file for writing */
outfile = g_fopen (filename, "wb"); outfile = g_fopen (filename, "wb");
if (!outfile) if (!outfile)
@ -802,11 +807,6 @@ save_image (const gchar *filename,
} }
/* init the progress meter */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* write the GIFheader */ /* write the GIFheader */
if (colors < 256) if (colors < 256)

View File

@ -662,13 +662,13 @@ gih_load_image (GFile *file,
GimpParasite *pipe_parasite; GimpParasite *pipe_parasite;
gsize bytes_read; gsize bytes_read;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
input = G_INPUT_STREAM (g_file_read (file, NULL, error)); input = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (! input) if (! input)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
/* The file format starts with a painfully simple text header */ /* The file format starts with a painfully simple text header */
/* get the name */ /* get the name */
@ -1294,13 +1294,13 @@ gih_save_image (GFile *file,
imagew = gimp_image_width (image_ID); imagew = gimp_image_width (image_ID);
imageh = gimp_image_height (image_ID); imageh = gimp_image_height (image_ID);
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error)); output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error));
if (! output) if (! output)
return FALSE; return FALSE;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
parstring = gimp_pixpipe_params_build (&gihparams); parstring = gimp_pixpipe_params_build (&gihparams);
header = g_strdup_printf ("%s\n%d %s\n", header = g_strdup_printf ("%s\n%d %s\n",

View File

@ -233,6 +233,9 @@ save_image (const gchar *filename,
cols = gegl_buffer_get_width (buffer); cols = gegl_buffer_get_width (buffer);
rows = gegl_buffer_get_height (buffer); rows = gegl_buffer_get_height (buffer);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
fp = g_fopen (filename, "w"); fp = g_fopen (filename, "w");
if (! fp) if (! fp)
@ -260,9 +263,6 @@ save_image (const gchar *filename,
fprintf (fp, "<CAPTION>%s</CAPTION>\n", fprintf (fp, "<CAPTION>%s</CAPTION>\n",
gtmvals.captiontxt); gtmvals.captiontxt);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
buf = g_newa (guchar, babl_format_get_bytes_per_pixel (format)); buf = g_newa (guchar, babl_format_get_bytes_per_pixel (format));
buf2 = g_newa (guchar, babl_format_get_bytes_per_pixel (format)); buf2 = g_newa (guchar, babl_format_get_bytes_per_pixel (format));

View File

@ -317,13 +317,13 @@ load_image (GFile *file,
GimpImageType image_type; GimpImageType image_type;
gsize bytes_read; gsize bytes_read;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
input = G_INPUT_STREAM (g_file_read (file, NULL, error)); input = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (! input) if (! input)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
if (! g_input_stream_read_all (input, &ph, sizeof (PatternHeader), if (! g_input_stream_read_all (input, &ph, sizeof (PatternHeader),
&bytes_read, NULL, error) || &bytes_read, NULL, error) ||
bytes_read != sizeof (PatternHeader)) bytes_read != sizeof (PatternHeader))
@ -515,13 +515,13 @@ save_image (GFile *file,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error)); output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error));
if (! output) if (! output)
return FALSE; return FALSE;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
buffer = gimp_drawable_get_buffer (drawable_ID); buffer = gimp_drawable_get_buffer (drawable_ID);
width = gegl_buffer_get_width (buffer); width = gegl_buffer_get_width (buffer);

View File

@ -356,6 +356,9 @@ load_image (const gchar *filename,
guchar *dest, cmap[768]; guchar *dest, cmap[768];
guint8 header_buf[128]; guint8 header_buf[128];
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fd = g_fopen (filename, "rb"); fd = g_fopen (filename, "rb");
if (! fd) if (! fd)
@ -366,9 +369,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
if (fread (header_buf, 128, 1, fd) == 0) if (fread (header_buf, 128, 1, fd) == 0)
{ {
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,

View File

@ -357,13 +357,13 @@ load_image (GFile *file,
PIX_DEBUG_PRINT ("Opening file: %s\n", filename); PIX_DEBUG_PRINT ("Opening file: %s\n", filename);
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
input = G_INPUT_STREAM (g_file_read (file, NULL, error)); input = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (! input) if (! input)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
/* Read header information */ /* Read header information */
if (! get_short (input, &width, error) || if (! get_short (input, &width, error) ||
! get_short (input, &height, error) || ! get_short (input, &height, error) ||
@ -536,13 +536,13 @@ save_image (GFile *file,
guchar *src; guchar *src;
guchar *src_base; guchar *src_base;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error)); output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error));
if (! output) if (! output)
return FALSE; return FALSE;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
/* Get info about image */ /* Get info about image */
buffer = gimp_drawable_get_buffer (drawable_ID); buffer = gimp_drawable_get_buffer (drawable_ID);

View File

@ -855,6 +855,9 @@ load_image (const gchar *filename,
* Open the file and initialize the PNG read "engine"... * Open the file and initialize the PNG read "engine"...
*/ */
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fp = g_fopen (filename, "rb"); fp = g_fopen (filename, "rb");
if (fp == NULL) if (fp == NULL)
@ -867,9 +870,6 @@ load_image (const gchar *filename,
png_init_io (pp, fp); png_init_io (pp, fp);
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* /*
* Get the image dimensions and create the image... * Get the image dimensions and create the image...
*/ */
@ -1480,6 +1480,9 @@ save_image (const gchar *filename,
* Open the file and initialize the PNG write "engine"... * Open the file and initialize the PNG write "engine"...
*/ */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
fp = g_fopen (filename, "wb"); fp = g_fopen (filename, "wb");
if (fp == NULL) if (fp == NULL)
{ {
@ -1491,9 +1494,6 @@ save_image (const gchar *filename,
png_init_io (pp, fp); png_init_io (pp, fp);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* /*
* Get the buffer for the current image... * Get the buffer for the current image...
*/ */

View File

@ -494,14 +494,13 @@ load_image (GFile *file,
PNMScanner *volatile scan; PNMScanner *volatile scan;
int ctr; int ctr;
/* open the file */ gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
input = G_INPUT_STREAM (g_file_read (file, NULL, error)); input = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (! input) if (! input)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
g_file_get_parse_name (file));
/* allocate the necessary structures */ /* allocate the necessary structures */
pnminfo = g_new (PNMInfo, 1); pnminfo = g_new (PNMInfo, 1);
@ -1052,14 +1051,14 @@ save_image (GFile *file,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
/* open the file */ /* open the file */
output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error)); output = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, error));
if (! output) if (! output)
return FALSE; return FALSE;
gimp_progress_init_printf (_("Saving '%s'"),
g_file_get_parse_name (file));
buffer = gimp_drawable_get_buffer (drawable_ID); buffer = gimp_drawable_get_buffer (drawable_ID);
xres = gegl_buffer_get_width (buffer); xres = gegl_buffer_get_width (buffer);

View File

@ -1011,6 +1011,9 @@ load_image (const gchar *filename,
g_print (" GraphicsAlphaBits: %d\n", plvals.graphicsalpha); g_print (" GraphicsAlphaBits: %d\n", plvals.graphicsalpha);
#endif #endif
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* Try to see if PostScript file is available */ /* Try to see if PostScript file is available */
ifp = g_fopen (filename, "r"); ifp = g_fopen (filename, "r");
if (ifp == NULL) if (ifp == NULL)
@ -1022,9 +1025,6 @@ load_image (const gchar *filename,
} }
fclose (ifp); fclose (ifp);
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
ifp = ps_open (filename, &plvals, &llx, &lly, &urx, &ury, &is_epsf); ifp = ps_open (filename, &plvals, &llx, &lly, &urx, &ury, &is_epsf);
if (!ifp) if (!ifp)
{ {
@ -1187,6 +1187,9 @@ save_image (const gchar *filename,
break; break;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Open the output file. */ /* Open the output file. */
ofp = g_fopen (filename, "wb"); ofp = g_fopen (filename, "wb");
if (!ofp) if (!ofp)
@ -1197,9 +1200,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
save_ps_header (ofp, filename); save_ps_header (ofp, filename);
switch (drawable_type) switch (drawable_type)

View File

@ -899,6 +899,9 @@ load_image (const gchar *filename,
data = g_new0 (RawGimpData, 1); data = g_new0 (RawGimpData, 1);
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
data->fp = g_fopen (filename, "rb"); data->fp = g_fopen (filename, "rb");
if (! data->fp) if (! data->fp)
{ {
@ -908,9 +911,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
size = get_file_info (filename); size = get_file_info (filename);
switch (runtime->image_type) switch (runtime->image_type)

View File

@ -426,6 +426,9 @@ load_image (const gchar *filename,
L_SUNFILEHEADER sunhdr; L_SUNFILEHEADER sunhdr;
guchar *suncolmap = NULL; guchar *suncolmap = NULL;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
ifp = g_fopen (filename, "rb"); ifp = g_fopen (filename, "rb");
if (!ifp) if (!ifp)
{ {
@ -526,9 +529,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
switch (sunhdr.l_ras_depth) switch (sunhdr.l_ras_depth)
{ {
case 1: /* bitmap */ case 1: /* bitmap */
@ -599,6 +599,9 @@ save_image (const gchar *filename,
break; break;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Open the output file. */ /* Open the output file. */
ofp = g_fopen (filename, "wb"); ofp = g_fopen (filename, "wb");
if (! ofp) if (! ofp)
@ -609,9 +612,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
if (drawable_type == GIMP_INDEXED_IMAGE) if (drawable_type == GIMP_INDEXED_IMAGE)
retval = save_index (ofp,image_ID, drawable_ID, FALSE, psvals.rle); retval = save_index (ofp,image_ID, drawable_ID, FALSE, psvals.rle);
else if (drawable_type == GIMP_GRAY_IMAGE) else if (drawable_type == GIMP_GRAY_IMAGE)

View File

@ -435,6 +435,9 @@ load_image (const gchar *filename,
long offset; long offset;
gint32 image_ID = -1; gint32 image_ID = -1;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fp = g_fopen (filename, "rb"); fp = g_fopen (filename, "rb");
if (! fp) if (! fp)
@ -445,9 +448,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* Is file big enough for a footer? */ /* Is file big enough for a footer? */
if (!fseek (fp, -26L, SEEK_END)) if (!fseek (fp, -26L, SEEK_END))
{ {
@ -1173,6 +1173,9 @@ save_image (const gchar *filename,
width = gegl_buffer_get_width (buffer); width = gegl_buffer_get_width (buffer);
height = gegl_buffer_get_height (buffer); height = gegl_buffer_get_height (buffer);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
if ((fp = g_fopen (filename, "wb")) == NULL) if ((fp = g_fopen (filename, "wb")) == NULL)
{ {
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
@ -1181,9 +1184,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
header[0] = 0; /* No image identifier / description */ header[0] = 0; /* No image identifier / description */
if (dtype == GIMP_INDEXED_IMAGE) if (dtype == GIMP_INDEXED_IMAGE)

View File

@ -982,14 +982,14 @@ load_image (const gchar *filename,
guchar *pixels; guchar *pixels;
guint width, height; guint width, height;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
pixels = wmf_load_file (filename, &width, &height, error); pixels = wmf_load_file (filename, &width, &height, error);
if (! pixels) if (! pixels)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
image = gimp_image_new (width, height, GIMP_RGB); image = gimp_image_new (width, height, GIMP_RGB);
gimp_image_set_filename (image, filename); gimp_image_set_filename (image, filename);
gimp_image_set_resolution (image, gimp_image_set_resolution (image,

View File

@ -731,6 +731,9 @@ load_image (const gchar *filename,
0xff, 0xff, 0xff /* white */ 0xff, 0xff, 0xff /* white */
}; };
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fp = g_fopen (filename, "rb"); fp = g_fopen (filename, "rb");
if (! fp) if (! fp)
{ {
@ -740,9 +743,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
comment = fgetcomment (fp); comment = fgetcomment (fp);
/* Loosely parse the header */ /* Loosely parse the header */
@ -1023,6 +1023,9 @@ save_image (const gchar *filename,
dark = 1; dark = 1;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Now actually save the data. */ /* Now actually save the data. */
fp = g_fopen (filename, "w"); fp = g_fopen (filename, "w");
if (! fp) if (! fp)
@ -1033,9 +1036,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Maybe write the image comment. */ /* Maybe write the image comment. */
#if 0 #if 0
/* DISABLED - see http://bugzilla.gnome.org/show_bug.cgi?id=82763 */ /* DISABLED - see http://bugzilla.gnome.org/show_bug.cgi?id=82763 */

View File

@ -646,6 +646,9 @@ load_image (const gchar *filename,
gint img_height; gint img_height;
gint i, j; gint i, j;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* Open the file and check it is a valid X cursor */ /* Open the file and check it is a valid X cursor */
fp = g_fopen (filename, "rb"); fp = g_fopen (filename, "rb");
@ -665,9 +668,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* check dimension is valid. */ /* check dimension is valid. */
for (i = 0; i < imagesp->nimage; i++) for (i = 0; i < imagesp->nimage; i++)
@ -1451,6 +1451,9 @@ save_image (const gchar *filename,
0, 0,
NULL); NULL);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* /*
* Open the file pointer. * Open the file pointer.
*/ */
@ -1464,9 +1467,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* get layers */ /* get layers */
orig_layers = gimp_image_get_layers (orig_image_ID, &nlayers); orig_layers = gimp_image_get_layers (orig_image_ID, &nlayers);
layers = gimp_image_get_layers (image_ID, &nlayers); layers = gimp_image_get_layers (image_ID, &nlayers);

View File

@ -435,6 +435,9 @@ load_image (const gchar *filename,
L_XWDFILEHEADER xwdhdr; L_XWDFILEHEADER xwdhdr;
L_XWDCOLOR *xwdcolmap = NULL; L_XWDCOLOR *xwdcolmap = NULL;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
ifp = g_fopen (filename, "rb"); ifp = g_fopen (filename, "rb");
if (!ifp) if (!ifp)
{ {
@ -536,9 +539,6 @@ load_image (const gchar *filename,
goto out; goto out;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
depth = xwdhdr.l_pixmap_depth; depth = xwdhdr.l_pixmap_depth;
bpp = xwdhdr.l_bits_per_pixel; bpp = xwdhdr.l_bits_per_pixel;
@ -638,6 +638,9 @@ save_image (const gchar *filename,
break; break;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Open the output file. */ /* Open the output file. */
ofp = g_fopen (filename, "wb"); ofp = g_fopen (filename, "wb");
if (! ofp) if (! ofp)
@ -648,9 +651,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
switch (drawable_type) switch (drawable_type)
{ {
case GIMP_INDEXED_IMAGE: case GIMP_INDEXED_IMAGE:

View File

@ -197,6 +197,9 @@ ReadBMP (const gchar *name,
gchar magick[2]; gchar magick[2];
Bitmap_Channel masks[4]; Bitmap_Channel masks[4];
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (name));
filename = name; filename = name;
fd = g_fopen (filename, "rb"); fd = g_fopen (filename, "rb");
@ -208,9 +211,6 @@ ReadBMP (const gchar *name,
goto out; goto out;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (name));
/* It is a File. Now is it a Bitmap? Read the shortest possible header */ /* It is a File. Now is it a Bitmap? Read the shortest possible header */
if (!ReadOK (fd, magick, 2) || !(!strncmp (magick, "BA", 2) || if (!ReadOK (fd, magick, 2) || !(!strncmp (magick, "BA", 2) ||

View File

@ -312,6 +312,10 @@ WriteBMP (const gchar *filename,
gimp_set_data (SAVE_PROC, &BMPSaveData, sizeof (BMPSaveData)); gimp_set_data (SAVE_PROC, &BMPSaveData, sizeof (BMPSaveData));
/* Let's begin the progress */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Let's take some file */ /* Let's take some file */
outfile = g_fopen (filename, "wb"); outfile = g_fopen (filename, "wb");
if (!outfile) if (!outfile)
@ -332,10 +336,6 @@ WriteBMP (const gchar *filename,
g_object_unref (buffer); g_object_unref (buffer);
/* And let's begin the progress */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
cur_progress = 0; cur_progress = 0;
max_progress = drawable_height; max_progress = drawable_height;

View File

@ -171,6 +171,9 @@ load_image (const gchar *filename,
int end; int end;
int num; int num;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
loader = exr_loader_new (filename); loader = exr_loader_new (filename);
if (!loader) if (!loader)
{ {
@ -227,9 +230,6 @@ load_image (const gchar *filename,
goto out; goto out;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
image = gimp_image_new_with_precision (width, height, image = gimp_image_new_with_precision (width, height,
image_type, image_precision); image_type, image_precision);
if (image == -1) if (image == -1)

View File

@ -470,6 +470,9 @@ save_image (const gchar *filename,
break; break;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* Open the output file. */ /* Open the output file. */
ofp = fits_open (filename, "w"); ofp = fits_open (filename, "w");
if (!ofp) if (!ofp)
@ -480,9 +483,6 @@ save_image (const gchar *filename,
return (FALSE); return (FALSE);
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
retval = save_fits (ofp,image_ID, drawable_ID); retval = save_fits (ofp,image_ID, drawable_ID);
fits_close (ofp); fits_close (ofp);

View File

@ -491,6 +491,9 @@ load_image (const gchar *filename,
s_fli_header fli_header; s_fli_header fli_header;
gint cnt; gint cnt;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
file = g_fopen (filename ,"rb"); file = g_fopen (filename ,"rb");
if (!file) if (!file)
{ {
@ -500,9 +503,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
fli_read_header (file, &fli_header); fli_read_header (file, &fli_header);
if (fli_header.magic == NO_HEADER) if (fli_header.magic == NO_HEADER)
return -1; return -1;

View File

@ -86,6 +86,9 @@ load_image (const gchar *filename,
if (!preview) if (!preview)
{ {
jerr.pub.output_message = my_output_message; jerr.pub.output_message = my_output_message;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
} }
if ((infile = g_fopen (filename, "rb")) == NULL) if ((infile = g_fopen (filename, "rb")) == NULL)
@ -96,10 +99,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
if (!preview)
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
image_ID = -1; image_ID = -1;
/* Establish the setjmp return context for my_error_exit to use. */ /* Establish the setjmp return context for my_error_exit to use. */

View File

@ -122,6 +122,9 @@ load_image (const gchar *filename,
if (g_stat (filename, &st) == -1) if (g_stat (filename, &st) == -1)
return -1; return -1;
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
IFDBG(1) g_debug ("Open file %s", gimp_filename_to_utf8 (filename)); IFDBG(1) g_debug ("Open file %s", gimp_filename_to_utf8 (filename));
f = g_fopen (filename, "rb"); f = g_fopen (filename, "rb");
if (f == NULL) if (f == NULL)
@ -132,9 +135,6 @@ load_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* ----- Read the PSD file Header block ----- */ /* ----- Read the PSD file Header block ----- */
IFDBG(2) g_debug ("Read header block"); IFDBG(2) g_debug ("Read header block");
if (read_header_block (&img_a, f, &error) < 0) if (read_header_block (&img_a, f, &error) < 0)

View File

@ -1646,6 +1646,8 @@ save_image (const gchar *filename,
} }
g_free (layers); g_free (layers);
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
fd = g_fopen (filename, "wb"); fd = g_fopen (filename, "wb");
if (fd == NULL) if (fd == NULL)
@ -1656,9 +1658,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
} }
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
IFDBG g_print ("\tFile '%s' has been opened\n", IFDBG g_print ("\tFile '%s' has been opened\n",
gimp_filename_to_utf8 (filename)); gimp_filename_to_utf8 (filename));

View File

@ -71,6 +71,9 @@ load_thumbnail_image (const gchar *filename,
if (g_stat (filename, &st) == -1) if (g_stat (filename, &st) == -1)
return -1; return -1;
gimp_progress_init_printf (_("Opening thumbnail for '%s'"),
gimp_filename_to_utf8 (filename));
IFDBG(1) g_debug ("Open file %s", gimp_filename_to_utf8 (filename)); IFDBG(1) g_debug ("Open file %s", gimp_filename_to_utf8 (filename));
f = g_fopen (filename, "rb"); f = g_fopen (filename, "rb");
if (f == NULL) if (f == NULL)
@ -81,9 +84,6 @@ load_thumbnail_image (const gchar *filename,
return -1; return -1;
} }
gimp_progress_init_printf (_("Opening thumbnail for '%s'"),
gimp_filename_to_utf8 (filename));
/* ----- Read the PSD file Header block ----- */ /* ----- Read the PSD file Header block ----- */
IFDBG(2) g_debug ("Read header block"); IFDBG(2) g_debug ("Read header block");
if (read_header_block (&img_a, f, &error) < 0) if (read_header_block (&img_a, f, &error) < 0)

View File

@ -322,6 +322,9 @@ load_image (const gchar *filename,
* Open the file for reading... * Open the file for reading...
*/ */
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
sgip = sgiOpen (filename, SGI_READ, 0, 0, 0, 0, 0); sgip = sgiOpen (filename, SGI_READ, 0, 0, 0, 0, 0);
if (sgip == NULL) if (sgip == NULL)
{ {
@ -331,9 +334,6 @@ load_image (const gchar *filename,
return -1; return -1;
}; };
gimp_progress_init_printf (_("Opening '%s'"),
gimp_filename_to_utf8 (filename));
/* /*
* Get the image dimensions and create the image... * Get the image dimensions and create the image...
*/ */
@ -574,6 +574,9 @@ save_image (const gchar *filename,
* Open the file for writing... * Open the file for writing...
*/ */
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
sgip = sgiOpen (filename, SGI_WRITE, compression, 1, sgip = sgiOpen (filename, SGI_WRITE, compression, 1,
width, height, zsize); width, height, zsize);
if (sgip == NULL) if (sgip == NULL)
@ -584,9 +587,6 @@ save_image (const gchar *filename,
return FALSE; return FALSE;
}; };
gimp_progress_init_printf (_("Saving '%s'"),
gimp_filename_to_utf8 (filename));
/* /*
* Allocate memory for "tile_height" rows... * Allocate memory for "tile_height" rows...
*/ */