After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521436 - TIFF plug-in should set filename when importing a single image from a multi-image TIFF
TIFF plug-in should set filename when importing a single image from a multi-i...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.4.x
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-03-09 19:20 UTC by Dori
Modified: 2008-10-30 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dori 2008-03-09 19:20:49 UTC
When I open a TIFF that has multiple images I lose the name of the file when doing a save as. I'd like for gimp to remeber the name and location of the file from which I just imported to use as a starting point when doing a save as. This would save time as in almost all cases of workflow I'm starting with the same file name in the same directory. When Gimp does in the default home directory with the name of "Untitled" it's not really helping me. I would prefer to have the original name there, or even blank as it saves me from deleting Untitled. I don't imagine people save their images as Untitled.

Thank you
Comment 1 Sven Neumann 2008-03-10 14:11:08 UTC
Works for me. Does this happen with all image files or only with multi-image TIFF files? What settings do you use to open the file?
Comment 2 Dori 2008-03-11 21:13:15 UTC
I was importing only one of the layers (shown as "Page 1"). The name is preserved if I import all layers. I think the name should remain no matter which or how many layers you import as they're all from the same file.

Thanks
Comment 3 Sven Neumann 2008-03-11 21:36:01 UTC
Definitely not as you would then overwrite the file when saving that image again. But the TIFF plug-in should set a name based on the filename.
Comment 4 Sven Neumann 2008-03-13 13:08:03 UTC
After looking at the code, I think it is best to do what the bug reporter suggested and always set the filename, even if only some images where selected for import:

2008-03-13  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff-load.c (load_image): set a filename on the
	image, even when not all images are imported as layers (bug #521436).
Comment 5 Michael Natterer 2008-03-13 17:16:26 UTC
Changed again in both branches to prevent data loss:

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.
Comment 6 Dori 2008-03-17 20:36:59 UTC
I'm not sure I get the naming convention, but if it becomes image.tiff-1-of-3 it would be more annoying than say image-1of3.tiff as then you wouldn't have to change the name to get the extension right.

Also, is it possible to also set the initial directory to be the same as the original TIFF? This would also save some work, and I'm not sure if the above patch does that.

Thanks
Comment 7 Sven Neumann 2008-03-18 07:44:38 UTC
The above patch sets the full filename. This includes the directory.
Comment 8 Sven Neumann 2008-03-18 07:48:07 UTC
And the naming is good as it is. Since GIMP doesn't save multi-image TIFF files, opening them is always an import. After you have imported pages from a TIFF image as layers, you can't save this again as a TIFF file. With the current naming, the file will be saved as XCF, which is the best choice for a multi-layered image.