diff --git a/ChangeLog b/ChangeLog index a4271ccbe9..a9904931bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-25 Mukund Sivaraman + + * plug-ins/common/tiff.c: fixed an issue where the page selection + dialog was being shown even for non-interactive runs. + 2007-04-24 Mukund Sivaraman * plug-ins/common/tiff.c: added support to load multi-page TIFF diff --git a/plug-ins/common/tiff.c b/plug-ins/common/tiff.c index e4188d5ac9..2e34f13546 100644 --- a/plug-ins/common/tiff.c +++ b/plug-ins/common/tiff.c @@ -580,6 +580,14 @@ load_dialog (const gchar *filename, TiffSelectedPages *pages) pages->n_pages = TIFFNumberOfDirectories (tif); + /* Return early if we're not running interactively */ + + if (run_mode != GIMP_RUN_INTERACTIVE) + { + pages->pages = g_new0 (gint, pages->n_pages); + + return TRUE; + } /* Return early if there are zero or one `pages' in the TIFF image */ @@ -592,8 +600,7 @@ load_dialog (const gchar *filename, TiffSelectedPages *pages) else if (pages->n_pages == 1) { target = GIMP_PAGE_SELECTOR_TARGET_IMAGES; - pages->pages = g_new (gint, 1); - *(pages->pages) = 0; + pages->pages = g_new0 (gint, pages->n_pages); return TRUE; }