mirror of https://github.com/GNOME/gimp.git
plug-ins/common/colortoalpha.c plug-ins/common/compose.c
2004-08-30 Sven Neumann <sven@gimp.org> * plug-ins/common/colortoalpha.c * plug-ins/common/compose.c * plug-ins/common/decompose.c * plug-ins/common/film.c * plug-ins/fits/fits.c: always use the progress API, not doing it in non-interactive mode has always been wrong.
This commit is contained in:
parent
13d9596812
commit
aeb5f302d5
|
@ -1,3 +1,12 @@
|
||||||
|
2004-08-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/colortoalpha.c
|
||||||
|
* plug-ins/common/compose.c
|
||||||
|
* plug-ins/common/decompose.c
|
||||||
|
* plug-ins/common/film.c
|
||||||
|
* plug-ins/fits/fits.c: always use the progress API, not doing it
|
||||||
|
in non-interactive mode has always been wrong.
|
||||||
|
|
||||||
2004-08-30 Manish Singh <yosh@gimp.org>
|
2004-08-30 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* libgimp/gimpprogress.[ch] (gimp_progress_uninstall): return the
|
* libgimp/gimpprogress.[ch] (gimp_progress_uninstall): return the
|
||||||
|
|
|
@ -174,9 +174,7 @@ run (const gchar *name,
|
||||||
if (gimp_drawable_is_rgb (drawable->drawable_id) &&
|
if (gimp_drawable_is_rgb (drawable->drawable_id) &&
|
||||||
gimp_drawable_is_layer (drawable->drawable_id))
|
gimp_drawable_is_layer (drawable->drawable_id))
|
||||||
{
|
{
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_init (_("Removing color..."));
|
||||||
gimp_progress_init (_("Removing color..."));
|
|
||||||
|
|
||||||
toalpha (drawable);
|
toalpha (drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -410,8 +410,7 @@ run (const gchar *name,
|
||||||
|
|
||||||
if (status == GIMP_PDB_SUCCESS)
|
if (status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_init (_("Composing..."));
|
||||||
gimp_progress_init (_("Composing..."));
|
|
||||||
|
|
||||||
image_ID = compose (composevals.compose_type,
|
image_ID = compose (composevals.compose_type,
|
||||||
composevals.compose_ID,
|
composevals.compose_ID,
|
||||||
|
@ -572,8 +571,7 @@ compose (const gchar *compose_type,
|
||||||
|
|
||||||
i += scan_lines;
|
i += scan_lines;
|
||||||
|
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_update ((gdouble) i / (gdouble) height);
|
||||||
gimp_progress_update (((gdouble)i) / (gdouble)height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < num_images; j++)
|
for (j = 0; j < num_images; j++)
|
||||||
|
|
|
@ -327,8 +327,7 @@ run (const gchar *name,
|
||||||
}
|
}
|
||||||
if (status == GIMP_PDB_SUCCESS)
|
if (status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_init (_("Decomposing..."));
|
||||||
gimp_progress_init (_("Decomposing..."));
|
|
||||||
|
|
||||||
num_images = decompose (param[1].data.d_image, param[2].data.d_drawable,
|
num_images = decompose (param[1].data.d_image, param[2].data.d_drawable,
|
||||||
decovals.extract_type, image_ID_extract);
|
decovals.extract_type, image_ID_extract);
|
||||||
|
@ -511,8 +510,7 @@ decompose (gint32 image_ID,
|
||||||
scan_lines);
|
scan_lines);
|
||||||
i += scan_lines;
|
i += scan_lines;
|
||||||
|
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_update ((gdouble) i / (gdouble) height);
|
||||||
gimp_progress_update (((gdouble)i) / (gdouble)height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (src);
|
g_free (src);
|
||||||
|
|
|
@ -323,8 +323,7 @@ run (const gchar *name,
|
||||||
|
|
||||||
if (status == GIMP_PDB_SUCCESS)
|
if (status == GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_init (_("Composing Images..."));
|
||||||
gimp_progress_init (_("Composing Images..."));
|
|
||||||
|
|
||||||
image_ID = film ();
|
image_ID = film ();
|
||||||
|
|
||||||
|
@ -537,9 +536,8 @@ film (void)
|
||||||
|
|
||||||
picture_x0 += picture_width + (picture_space/2);
|
picture_x0 += picture_width + (picture_space/2);
|
||||||
|
|
||||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
gimp_progress_update (((gdouble) (picture_count + 1)) /
|
||||||
gimp_progress_update (((gdouble) (picture_count + 1)) /
|
(gdouble) num_pictures);
|
||||||
(gdouble) num_pictures);
|
|
||||||
|
|
||||||
picture_count++;
|
picture_count++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,15 +456,13 @@ save_image (const gchar *filename,
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l_run_mode != GIMP_RUN_NONINTERACTIVE)
|
temp = g_strdup_printf (_("Saving '%s'..."),
|
||||||
{
|
gimp_filename_to_utf8 (filename));
|
||||||
temp = g_strdup_printf (_("Saving '%s'..."),
|
gimp_progress_init (temp);
|
||||||
gimp_filename_to_utf8 (filename));
|
g_free (temp);
|
||||||
gimp_progress_init (temp);
|
|
||||||
g_free (temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((drawable_type == GIMP_INDEXED_IMAGE) || (drawable_type == GIMP_INDEXEDA_IMAGE))
|
if ((drawable_type == GIMP_INDEXED_IMAGE) ||
|
||||||
|
(drawable_type == GIMP_INDEXEDA_IMAGE))
|
||||||
retval = save_index (ofp,image_ID, drawable_ID);
|
retval = save_index (ofp,image_ID, drawable_ID);
|
||||||
else
|
else
|
||||||
retval = save_direct (ofp,image_ID, drawable_ID);
|
retval = save_direct (ofp,image_ID, drawable_ID);
|
||||||
|
@ -604,8 +602,8 @@ load_fits (const gchar *filename,
|
||||||
|
|
||||||
scan_lines++;
|
scan_lines++;
|
||||||
|
|
||||||
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
|
if ((i % 20) == 0)
|
||||||
gimp_progress_update ((double)(i+1) / (double)height);
|
gimp_progress_update ((gdouble) (i + 1) / (gdouble) height);
|
||||||
|
|
||||||
if ((scan_lines == tile_height) || ((i+1) == height))
|
if ((scan_lines == tile_height) || ((i+1) == height))
|
||||||
{
|
{
|
||||||
|
@ -656,9 +654,9 @@ load_fits (const gchar *filename,
|
||||||
dest -= width*ncompose;
|
dest -= width*ncompose;
|
||||||
scan_lines++;
|
scan_lines++;
|
||||||
|
|
||||||
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
|
if ((i % 20) == 0)
|
||||||
gimp_progress_update ( (double)(channel*height+i+1)
|
gimp_progress_update ((gdouble) (channel * height + i + 1) /
|
||||||
/ (double)(height*ncompose));
|
(gdouble) (height * ncompose));
|
||||||
|
|
||||||
if ((scan_lines == tile_height) || ((i+1) == height))
|
if ((scan_lines == tile_height) || ((i+1) == height))
|
||||||
{
|
{
|
||||||
|
@ -810,8 +808,9 @@ save_direct (FITS_FILE *ofp,
|
||||||
nbytes += bpsl;
|
nbytes += bpsl;
|
||||||
src -= 2*bpsl;
|
src -= 2*bpsl;
|
||||||
|
|
||||||
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
|
if ((i % 20) == 0)
|
||||||
gimp_progress_update ((double)(i+channel*height)/(double)(height*bpp));
|
gimp_progress_update ((gdouble) (i + channel * height) /
|
||||||
|
(gdouble) (height * bpp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -909,9 +908,9 @@ save_index (FITS_FILE *ofp,
|
||||||
src -= 2*bpsl;
|
src -= 2*bpsl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
|
if ((i % 20) == 0)
|
||||||
gimp_progress_update ((double) (i+channel*height) /
|
gimp_progress_update ((gdouble) (i + channel * height) /
|
||||||
(double) (height*(bpp+2)));
|
(gdouble) (height * (bpp + 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the Alpha-channel */
|
/* Write the Alpha-channel */
|
||||||
|
@ -934,9 +933,9 @@ save_index (FITS_FILE *ofp,
|
||||||
src -= 2*bpsl;
|
src -= 2*bpsl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
|
if ((i % 20) == 0)
|
||||||
gimp_progress_update ((double) (i+channel*height) /
|
gimp_progress_update ((gdouble) (i + channel * height) /
|
||||||
(double) (height*(bpp+2)));
|
(gdouble) (height * (bpp + 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
nbytes = nbytes % FITS_RECORD_SIZE;
|
nbytes = nbytes % FITS_RECORD_SIZE;
|
||||||
|
|
Loading…
Reference in New Issue