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 384472 - "Open As Layers...", Layer Names...
"Open As Layers...", Layer Names...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-12-10 19:18 UTC by jbaker
Modified: 2006-12-11 18:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jbaker 2006-12-10 19:18:25 UTC
When using File > Open As Layers, or when dragging a file onto an image, the new layers are named Background Copy, Background Copy#1, etc... The more images that are added this way, the harder it is to keep track...

I was wondering if the layer names could be changed to reflect the file and type it came from... Like: anImage.jpg, anotherOne.png, etc...
Comment 1 Sven Neumann 2006-12-10 19:36:07 UTC
Yes, something like that could probably be done easily.
Comment 2 Sven Neumann 2006-12-11 13:06:08 UTC
Actually, the code tries to preserve the layer names from the images you open. If you tell it to merge visible layers, it can't do that and will use the filename as you suggested. But in the case where you are adding the layers as is, the layer name isn't touched. The fact that you may end up with the layer names as you described is due to the fact that not all file formats have a concept of layer names. The file load plug-ins then use "Background" as a fallback layer name.

I am afraid I don't see any reasoanble way to change this. The core simply doesn't know if the layer name is coming from the file or if it was just added by the file load plug-in.
Comment 3 Michael Natterer 2006-12-11 13:26:08 UTC
what about:

layer_name = g_strdup_printf ("%s-%s", filename, orig_layer_name);
Comment 4 Sven Neumann 2006-12-11 13:31:47 UTC
That would work but could easily cause quite long and ugly layer names. But I can't think of anything better right now. Except that I would suggest to use "%s - %s" instead of "%s-%s".
Comment 5 Michael Natterer 2006-12-11 18:39:26 UTC
Fixed in CVS:

2006-12-11  Michael Natterer  <mitch@gimp.org>

	* app/file/file-open.c (file_open_layers): use the image file's
	basename as layer name if we import only one layer or if
	merge_visible was requested. Use "basename - layer name"
	otherwise. Fixes bug #384472.