set the original filename only if all pages were loaded as layers; if a

2008-03-13  Michael Natterer  <mitch@gimp.org>

	* plug-ins/common/tiff-load.c (load_image): set the original
	filename only if all pages were loaded as layers; if a subset was
	loaded, set the filename to "<filename>.tiff-n-of-m-pages" so a
	simple "save" won't overwrite the original file without the user
	changing the filename explicitely.


svn path=/trunk/; revision=25103
This commit is contained in:
Michael Natterer 2008-03-13 17:11:06 +00:00 committed by Michael Natterer
parent 671cdc17db
commit 8955dffc24
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2008-03-13 Michael Natterer <mitch@gimp.org>
* plug-ins/common/tiff-load.c (load_image): set the original
filename only if all pages were loaded as layers; if a subset was
loaded, set the filename to "<filename>.tiff-n-of-m-pages" so a
simple "save" won't overwrite the original file without the user
changing the filename explicitely.
2008-03-13 Sven Neumann <sven@gimp.org>
* plug-ins/common/tiff-load.c (load_image): set a filename on the

View file

@ -741,6 +741,14 @@ load_image (const gchar *filename,
images_list = g_list_prepend (images_list,
GINT_TO_POINTER (image));
}
else if (pages->o_pages != pages->n_pages)
{
gchar *fname = g_strdup_printf (_("%s-%d-of-%d-pages"), filename,
pages->n_pages, pages->o_pages);
gimp_image_set_filename (image, fname);
g_free (fname);
}
else
{
gimp_image_set_filename (image, filename);