Commit 8ff66342 authored by Mikael Magnusson's avatar Mikael Magnusson

plug-ins: set progress to 1.0 when done

parent 7552d1aa
......@@ -269,6 +269,7 @@ color_rotate (GimpDrawable *drawable)
/* update the processed region */
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, (x2 - x1), (y2 - y1));
......
......@@ -1087,6 +1087,7 @@ do_optimizations (GimpRunMode run_mode,
gimp_progress_update (((gdouble) this_frame_num + 1.0) /
((gdouble) total_frames));
}
gimp_progress_update (1.0);
}
gimp_image_undo_enable (new_image_id);
......
......@@ -313,7 +313,7 @@ render (GimpDrawable *drawable)
gimp_progress_update ((gdouble) row / (gdouble) h);
}
gimp_progress_update ((gdouble) 100);
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x, y, w, h);
......
......@@ -1507,6 +1507,7 @@ strucpi (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the textured region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -713,6 +713,7 @@ apply_blinds (GimpDrawable *drawable)
g_free (src_rows);
g_free (des_rows);
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -763,6 +763,7 @@ sel_gauss (GimpDrawable *drawable,
matrixmult (src, dest, width, height, mat, numrad,
bytes, has_alpha, maxdelta, FALSE);
gimp_progress_update (1.0);
gimp_pixel_rgn_init (&dest_rgn,
drawable, x, y, width, height, TRUE, TRUE);
......
......@@ -1475,6 +1475,7 @@ gauss (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* merge the shadow, update the drawable */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -524,6 +524,7 @@ bumpmap (void)
}
/* Done */
gimp_progress_update (1.0);
g_free (bm_row1);
g_free (bm_row2);
......
......@@ -592,6 +592,7 @@ cartoon (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* merge the shadow, update the drawable */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -777,6 +777,7 @@ exchange (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the processed region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -885,6 +885,7 @@ compose (const gchar *compose_type,
gimp_progress_update ((gdouble) i / (gdouble) height);
}
gimp_progress_update (1.0);
for (j = 0; j < num_images; j++)
{
......
......@@ -674,6 +674,7 @@ convolve_image (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -3192,6 +3192,7 @@ p_vertical_bend (BenderDialog *cd,
}
}
}
gimp_progress_update (1.0);
g_free (last_arr);
g_free (first_arr);
......
......@@ -646,6 +646,7 @@ decompose (gint32 image_ID,
gimp_progress_update ((gdouble) i / (gdouble) height);
}
gimp_progress_update (1.0);
g_free (src);
......
......@@ -295,6 +295,7 @@ deinterlace (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the deinterlaced region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -523,6 +523,7 @@ DepthMerge_execute (DepthMerge *dm)
g_free (depthMap2Row);
g_free (tempRow);
gimp_progress_update (1.0);
gimp_drawable_flush (dm->resultDrawable);
gimp_drawable_merge_shadow (dm->resultDrawable->drawable_id, TRUE);
gimp_drawable_update (dm->resultDrawable->drawable_id,
......
......@@ -413,6 +413,7 @@ destripe (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -765,6 +765,7 @@ displace (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -369,6 +369,7 @@ laplace (GimpDrawable *drawable)
gimp_progress_update ((gdouble) row / (gdouble) (y2 - y1));
}
gimp_progress_update (1.0);
/* update the laplaced region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -490,6 +490,7 @@ neon (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* now, merge horizontal and vertical into a magnitude */
gimp_pixel_rgn_init (&src_rgn, drawable,
0, 0, drawable->width, drawable->height,
......
......@@ -470,6 +470,7 @@ sobel (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the sobeled region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -501,6 +501,7 @@ engrave_small (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1);
......
......@@ -448,6 +448,7 @@ load_image (const gchar *file,
gimp_pixel_rgn_set_rect (&pixel_rgn, line, 0, i, drawable->width, 1);
gimp_progress_update ((float) i / (float) height);
}
gimp_progress_update (1.0);
/* Close image files, give back allocated memory */
......@@ -674,6 +675,7 @@ save_image (const gchar *file,
gimp_progress_update ((float) i / (float) drawable->height);
}
gimp_progress_update (1.0);
/* Close files, give back allocated memory */
fclose (fp);
......
......@@ -756,6 +756,7 @@ dicom_loader (guint8 *pix_buffer,
gimp_pixel_rgn_set_rect (pixel_rgn, data, 0, row_idx, width, scanlines);
row_idx += scanlines;
}
gimp_progress_update (1.0);
g_free (data);
}
......
......@@ -1152,6 +1152,7 @@ ReadImage (FILE *fd,
if (LZWReadByte (fd, FALSE, c) >= 0)
g_print ("GIF: too much input data, ignoring extra...\n");
gimp_progress_update (1.0);
gimp_pixel_rgn_init (&pixel_rgn, drawable,
0, 0, drawable->width, drawable->height, TRUE, FALSE);
gimp_pixel_rgn_set_rect (&pixel_rgn, dest,
......
......@@ -942,16 +942,17 @@ save_image (const gchar *filename,
get_pixel);
}
gif_encode_image_data (outfile, cols, rows,
(rows > 4) ? gsvals.interlace : 0,
useBPP,
get_pixel,
offset_x, offset_y);
gif_encode_image_data (outfile, cols, rows,
(rows > 4) ? gsvals.interlace : 0,
useBPP,
get_pixel,
offset_x, offset_y);
gimp_progress_update (1.0);
gimp_drawable_detach (drawable);
gimp_drawable_detach (drawable);
g_free (pixels);
}
g_free (pixels);
}
g_free(layers);
......
......@@ -374,6 +374,7 @@ save_image (const gchar *filename,
gimp_progress_update ((double) y / (double) rows);
}
gimp_progress_update (1.0);
if (gtmvals.fulldoc)
fprintf (fp, "</TABLE></BODY></HTML>\n");
......
......@@ -458,6 +458,7 @@ load_image (const gchar *filename,
gimp_progress_update ((gdouble) line / (gdouble) ph.height);
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
......
......@@ -468,6 +468,8 @@ load_image (const gchar *filename,
return -1;
}
gimp_progress_update (1.0);
gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, width, height, TRUE, FALSE);
gimp_pixel_rgn_set_rect (&pixel_rgn, dest, 0, 0, width, height);
......
......@@ -665,7 +665,8 @@ load_image (PopplerDocument *doc,
image_ID = 0;
}
}
}
gimp_progress_update (1.0);
if (image_ID)
{
......
......@@ -475,6 +475,8 @@ load_image (const gchar *filename,
g_free (dest_base);
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable);
......@@ -636,6 +638,7 @@ save_image (const gchar *filename,
gimp_progress_update ((double) i / (double) drawable->height);
}
}
gimp_progress_update (1.0);
g_free (src_base);
......
......@@ -1565,6 +1565,8 @@ save_image (const gchar *filename,
}
}
gimp_progress_update (1.0);
png_write_end (pp, info);
png_destroy_write_struct (&pp, &info);
......
......@@ -2128,6 +2128,7 @@ load_ps (const gchar *filename,
if (err) break;
}
}
gimp_progress_update (1.0);
g_free (data);
g_free (byteline);
......@@ -2498,6 +2499,7 @@ save_ps_preview (FILE *ofp,
if ((y % 20) == 0)
gimp_progress_update ((double)(y) / (double)height);
}
gimp_progress_update (1.0);
fprintf (ofp, "%%%%EndPreview\n");
......@@ -2581,6 +2583,7 @@ save_gray (FILE *ofp,
if ((i % 20) == 0)
gimp_progress_update ((double) i / (double) height);
}
gimp_progress_update (1.0);
if (level2)
{
......@@ -2710,6 +2713,7 @@ save_bw (FILE *ofp,
if ((i % 20) == 0)
gimp_progress_update ((double) i / (double) height);
}
gimp_progress_update (1.0);
if (level2)
{
......@@ -2865,6 +2869,7 @@ save_index (FILE *ofp,
if ((i % 20) == 0)
gimp_progress_update ((double) i / (double) height);
}
gimp_progress_update (1.0);
ps_end_data (ofp);
fprintf (ofp, "showpage\n");
......@@ -2994,6 +2999,7 @@ save_rgb (FILE *ofp,
if ((i % 20) == 0)
gimp_progress_update ((double) i / (double) height);
}
gimp_progress_update (1.0);
ps_end_data (ofp);
fprintf (ofp, "showpage\n");
......
......@@ -482,6 +482,7 @@ raw_load_planar (RawGimpData *data)
gimp_pixel_rgn_set_row (&data->region, row, 0, i, runtime->image_width);
gimp_progress_update ((gfloat) i / (gfloat) runtime->image_height);
}
gimp_progress_update (1.0);
g_free (row);
g_free (r_row);
......
......@@ -509,6 +509,7 @@ load_image (const gchar *filename,
image_ID = -1;
break;
}
gimp_progress_update (1.0);
fclose (ifp);
......
......@@ -1118,6 +1118,7 @@ ReadImage (FILE *fp,
info->width, tileheight);
}
}
gimp_progress_update (1.0);
g_free (data);
g_free (buffer);
......@@ -1340,6 +1341,7 @@ save_image (const gchar *filename,
if (row % 16 == 0)
gimp_progress_update ((gdouble) row / (gdouble) height);
}
gimp_progress_update (1.0);
gimp_drawable_detach (drawable);
......
......@@ -946,6 +946,7 @@ load_image (const gchar *filename,
gimp_progress_update ((double) (i + tileheight) / (double) height);
gimp_pixel_rgn_set_rect (&pixel_rgn, data, 0, i, width, tileheight);
}
gimp_progress_update (1.0);
g_free (data);
......@@ -1162,6 +1163,7 @@ save_image (const gchar *filename,
gimp_progress_update ((double) (i + tileheight) / (double) height);
}
gimp_progress_update (1.0);
/* Write the trailer. */
fprintf (fp, " };\n");
......
......@@ -769,6 +769,7 @@ load_image (const gchar *filename, GError **error)
gimp_progress_update ( (i + 1) / imagesp->nimage);
}
gimp_progress_update (1.0);
/* free temporary buffer */
g_free(tmppixel);
......@@ -1655,6 +1656,7 @@ save_image (const gchar *filename,
gimp_progress_update ((i + 1) / imagesp->nimage);
}
gimp_progress_update (1.0);
/*
* comment parsing
......
......@@ -521,6 +521,7 @@ parse_image (gint32 image_ID,
drawable->width, scanlines);
}
gimp_progress_update (1.0);
g_free(buf);
......@@ -704,6 +705,7 @@ save_image (const gchar *filename,
gimp_progress_update ((gdouble) (i+j) / (gdouble) height);
}
}
gimp_progress_update (1.0);
g_free (buffer);
......
......@@ -563,6 +563,7 @@ load_image (const gchar *filename,
}
break;
}
gimp_progress_update (1.0);
fclose (ifp);
......@@ -632,6 +633,8 @@ save_image (const gchar *filename,
else
retval = FALSE;
gimp_progress_update (1.0);
fclose (ofp);
return retval;
......
......@@ -518,6 +518,7 @@ film (void)
g_free (layers);
gimp_image_delete (image_ID_tmp);
}
gimp_progress_update (1.0);
gimp_image_flatten (image_ID_dst);
......
......@@ -502,6 +502,7 @@ grid (gint32 image_ID,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -548,6 +548,7 @@ pluginCore (piArgs *argp)
}
}
}
gimp_progress_update (1.0);
gimp_pixel_rgn_set_rect (&dstPr, dst, sel_x1, sel_y1, width, height);
......
......@@ -752,6 +752,7 @@ iwarp_frame (void)
&progress, max_progress);
}
}
gimp_progress_update (1.0);
gimp_drawable_flush (destdrawable);
gimp_drawable_merge_shadow (destdrawable->drawable_id, TRUE);
......@@ -831,6 +832,7 @@ iwarp (void)
gimp_image_insert_layer (imageID, layerID, -1, 0);
}
gimp_progress_update (1.0);
}
g_free (animlayers);
}
......
......@@ -602,6 +602,7 @@ draw_jigsaw (guchar *buffer,
printf("draw_jigsaw: bad style\n");
gimp_quit ();
}
gimp_progress_update (1.0);
g_free (globals.gridx);
g_free (globals.gridy);
......
......@@ -362,6 +362,7 @@ drawlens (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_pixel_rgn_set_rect (&destPR, dest, x1, y1,
regionwidth, regionheight);
......
......@@ -472,6 +472,7 @@ FlareFX (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the textured region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -2064,6 +2064,7 @@ do { \
}
else
{
gimp_progress_update (1.0);
/* update the affected region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -990,6 +990,7 @@ nlfilter (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, width, height);
......
......@@ -980,6 +980,8 @@ nova (GimpDrawable *drawable,
gimp_progress_update ((gdouble) progress / (gdouble) max_progress);
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -731,6 +731,7 @@ oilify (GimpDrawable *drawable,
if (!preview)
{
gimp_progress_update (1.0);
/* Update the oil-painted region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -617,6 +617,7 @@ photocopy (GimpDrawable *drawable,
if (! preview)
{
gimp_progress_update (1.0);
/* merge the shadow, update the drawable */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -610,6 +610,7 @@ pixelize_large (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
/* update the blurred region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......@@ -687,6 +688,7 @@ pixelize_small (GimpDrawable *drawable,
g_free(area.data);
gimp_progress_update (1.0);
/* update the pixelized region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -411,6 +411,8 @@ plasma (GimpDrawable *drawable,
{
depth++;
}
if (pft)
gimp_progress_update (1.0);
}
end_plasma (drawable, pft, gr);
......
......@@ -539,6 +539,7 @@ run (const gchar *name,
(gfloat) (sel_y2 - sel_y1));
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -324,6 +324,7 @@ remove_redeye (GimpDrawable *drawable)
gimp_progress_update ((gdouble) progress / (gdouble) max_progress);
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x, y, width, height);
......
......@@ -2736,6 +2736,8 @@ sample_analyze (t_GDRW *sample_gdrw)
}
}
}
if (g_show_progress)
gimp_progress_update (1.0);
if (g_Sdebug)
printf ("ROWS: %d - %d COLS: %d - %d\n",
......
......@@ -448,6 +448,7 @@ sharpen (GimpDrawable *drawable)
* Update the screen...
*/
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -327,6 +327,7 @@ shift (GimpDrawable *drawable,
if (! preview)
{
gimp_progress_update (1.0);
/* update the region */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -459,6 +459,7 @@ sinus (void)
gimp_progress_update ((double) progress / (double) max_progress);
}
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1);
......
......@@ -355,6 +355,7 @@ smooth_palette (GimpDrawable *drawable,
len_best = len;
}
}
gimp_progress_update (1.0);
memcpy (pal, pal_best, bpp * psize);
g_free (pal_best);
g_free (original);
......
......@@ -476,6 +476,7 @@ softglow (GimpDrawable *drawable,
if (! preview)
{
gimp_progress_update (1.0);
/* merge the shadow, update the drawable */
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
......
......@@ -3002,6 +3002,7 @@ realrender (GimpDrawable *drawable)
gimp_pixel_rgn_set_row (&dpr, ibuffer, x1, y1 + y, x2 - x1);
gimp_progress_update ((gdouble) y / (gdouble) ty);
}
gimp_progress_update (1.0);
g_free (buffer);
g_free (ibuffer);
gimp_drawable_flush (drawable);
......
......@@ -488,6 +488,7 @@ glasstile (GimpDrawable *drawable,
}
else
{
gimp_progress_update (1.0);
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
......
......@@ -809,6 +809,7 @@ filter (void)
gimp_pixel_rgn_set_rect (&dst, pixels, 0, 0, p.drawable->width,
p.drawable->height);
gimp_progress_update (1.0);
gimp_drawable_flush (p.drawable);
gimp_drawable_merge_shadow (p.drawable->drawable_id, TRUE);
gimp_drawable_update (p.drawable->drawable_id,
......
......@@ -351,6 +351,7 @@ tile (GimpDrawable *drawable)
tile_region (drawable, TRUE, x1, y1, x2, y2);
tile_region (drawable, FALSE, x1, y1, x2, y2);
gimp_progress_update (1.0);