diff --git a/ChangeLog b/ChangeLog index a6cf1a4574..030e0264f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 21 11:12:22 MEST 1999 Sven Neuman + + * plug-ins/gap/gap_lib.c + * plug-ins/gap/gap_range_ops.c + * plug-ins/gap/gap_split.c: applied patches from Wolfgang Hofer. + Tue Sep 21 11:07:23 MEST 1999 Sven Neuman * blend.c diff --git a/plug-ins/gap/gap_lib.c b/plug-ins/gap/gap_lib.c index 15e4781489..692e275463 100644 --- a/plug-ins/gap/gap_lib.c +++ b/plug-ins/gap/gap_lib.c @@ -28,6 +28,8 @@ */ /* revision history: + * 1.1.9a; 1999/09/14 hof: handle frame filenames with framenumbers + * that are not the 4digit style. (like frame1.xcf) * 1.1.8a; 1999/08/31 hof: for AnimFrame Filtypes != XCF: * p_decide_save_as does save INTERACTIVE at 1.st time * and uses RUN_WITH_LAST_VALS for subsequent calls @@ -425,18 +427,64 @@ char* p_alloc_extension(char *imagename) * p_alloc_fname * * build the name of a frame using "basename_0000.ext" + * * return name or NULL (if malloc fails) * ============================================================================ */ char* p_alloc_fname(char *basename, long nr, char *extension) { char *l_fname; + int l_leading_zeroes; + long l_nr_chk; if(basename == NULL) return (NULL); l_fname = (char *)g_malloc(strlen(basename) + strlen(extension) + 8); if(l_fname != NULL) { - sprintf(l_fname, "%s%04ld%s", basename, nr, extension); + l_leading_zeroes = TRUE; + if(nr < 1000) + { + /* try to figure out if the frame numbers are in + * 4-digit style, with leading zeroes "frame_0001.xcf" + * or not "frame_1.xcf" + */ + l_nr_chk = nr; + + while(l_nr_chk >= 0) + { + /* check if frame is on disk with 4-digit style framenumber */ + sprintf(l_fname, "%s%04ld%s", basename, l_nr_chk, extension); + if (p_file_exists(l_fname)) + { + break; + } + + /* now check for filename without leading zeroes in the framenumber */ + sprintf(l_fname, "%s%ld%s", basename, l_nr_chk, extension); + if (p_file_exists(l_fname)) + { + l_leading_zeroes = FALSE; + break; + } + l_nr_chk--; + + /* if the frames nr and nr-1 were not found + * try to check frames 1 and 0 + * to limit down the loop to max 4 cycles + */ + if((l_nr_chk == nr -2) && (l_nr_chk > 1)) + { + l_nr_chk = 1; + } + } + } + else + { + l_leading_zeroes = FALSE; + } + + if(l_leading_zeroes) sprintf(l_fname, "%s%04ld%s", basename, nr, extension); + else sprintf(l_fname, "%s%ld%s", basename, nr, extension); } return(l_fname); } /* end p_alloc_fname */ diff --git a/plug-ins/gap/gap_range_ops.c b/plug-ins/gap/gap_range_ops.c index cde504bcbf..1486a81a1e 100644 --- a/plug-ins/gap/gap_range_ops.c +++ b/plug-ins/gap/gap_range_ops.c @@ -32,6 +32,10 @@ */ /* revision history + * 1.1.9a 1999/09/21 hof: bugfix RUN_NONINTERACTIVE did not work in + * plug_in_gap_range_convert + * plug_in_gap_range_layer_del + * plug_in_gap_range_flatten * 1.1.8 1999/08/31 hof: frames convert: save subsequent frames * with rumode RUN_WITH_LAST_VALS * 0.97.00; 1998/10/19 hof: gap_range_to_multilayer: extended layer selection @@ -1229,6 +1233,7 @@ int gap_range_flatten(GRunModeType run_mode, gint32 image_id, } else { + l_rc = 0; l_from = range_from; l_to = range_to; } @@ -1408,6 +1413,7 @@ int gap_range_layer_del(GRunModeType run_mode, gint32 image_id, } else { + l_rc = 0; l_from = range_from; l_to = range_to; l_position = position; @@ -1485,6 +1491,7 @@ gint32 gap_range_conv(GRunModeType run_mode, gint32 image_id, } else { + l_rc = 0; l_from = range_from; l_to = range_to; l_flatten = flatten; diff --git a/plug-ins/gap/gap_split.c b/plug-ins/gap/gap_split.c index 456dc9624b..45c15d6be0 100644 --- a/plug-ins/gap/gap_split.c +++ b/plug-ins/gap/gap_split.c @@ -1,4 +1,4 @@ -/* gap_range_ops.c +/* gap_split.c * 1997.11.06 hof (Wolfgang Hofer) * * GAP ... Gimp Animation Plugins @@ -26,6 +26,7 @@ */ /* revision history + * 1.1.9a; 1999/09/21 hof: bugfix RUN_NONINTERACTIVE mode did not work * 1.1.8a; 1999/08/31 hof: accept anim framenames without underscore '_' * 1.1.5a; 1999/05/08 hof: bugix (dont mix GDrawableType with GImageType) * 0.96.00; 1998/07/01 hof: - added scale, resize and crop @@ -85,6 +86,7 @@ p_split_image(t_anim_info *ainfo_ptr, int l_idx; long l_layer_idx; + if(gap_debug) printf("DEBUG: p_split_image inv:%d no_alpha:%d ext:%s\n", (int)invers, (int)no_alpha, new_extension); l_rc = -1; l_percentage = 0.0; l_run_mode = ainfo_ptr->run_mode; @@ -93,7 +95,6 @@ p_split_image(t_anim_info *ainfo_ptr, gimp_progress_init("Splitting into Frames .."); } - l_new_image_id = -1; /* get info about the image */ l_width = gimp_image_width(ainfo_ptr->image_id); @@ -295,6 +296,7 @@ int gap_split_image(GRunModeType run_mode, } else { + l_rc = 0; l_inverse_order = inverse_order; l_no_alpha = no_alpha; strncpy(l_extension, extension, sizeof(l_extension) -1);