SUMMARY *** Dragging-and-dropping an image as a paint layer causes the layer name to be blank. *** STEPS TO REPRODUCE 1. Drag and drop an image into an open document, choosing "Insert as New Layer". OBSERVED RESULT The resulting layer's name is blank. EXPECTED RESULT The resulting layer's name is the image's filename. SOFTWARE/OS VERSIONS Krita git 389448dd39 ADDITIONAL INFORMATION I could be wrong, but it seems likely to be related to line 531 of libs/ui/KisView.cpp (changed in MR!1296): KisPaintLayerSP layer = new KisPaintLayer(this->image(), "", OPACITY_OPAQUE_U8, clip); The layer is initialized without a name and as far as I can tell is never given one, thus the bug.
One of the side effects of https://invent.kde.org/graphics/krita/-/merge_requests/1296 is that single layers are now consistently imported as paint devices, whether they were pasted from an image or from an URL. When an image is imported as a paint device, it only preserves the bitmap data, so the original file name is obviously lost upon return. On the other hand, multiple files are still handled via KisImageManager::importImage, which isn't affected. Not sure how (or if) I should fix it, so cc'ing Halla and Dmitry for a decision.
(awaiting for answer)
*** Bug 456096 has been marked as a duplicate of this bug. ***
Can also confirm this as of git (df921a2426)
I've posted a partial fix in https://invent.kde.org/graphics/krita/-/merge_requests/1482, it'll set the name to "Paint layer X (pasted)" as is done currently with other actions. I'm not sure if we can set a custom property ("name") to a paint device yet.
Thank you for the partial fix @amyspark, I understand it's a technical challenge here to get back the filename as a layer name, but getting it was super convenient for my workflow. eg. On my files, I have many texture already (file)named for this, like grids, perspective vanishing points, textures, photobash elements; ready to drag and drop.
Git commit 3706f1d50cd0b617f6180ae1425d001e47c8e26c by L. E. Segovia. Committed on 02/07/2022 at 00:42. Pushed by lsegovia into branch 'master'. Give new single-layer pastes a default name M +5 -1 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/3706f1d50cd0b617f6180ae1425d001e47c8e26c
Git commit ad2bbd1f67d13c3deea35c1cdf29ac7fada2b1a7 by L. E. Segovia. Committed on 02/07/2022 at 00:42. Pushed by lsegovia into branch 'master'. KisClipboard: decouple source selection and allow for manual import of single URLs M +153 -42 libs/ui/KisView.cpp M +43 -10 libs/ui/kis_clipboard.cc M +14 -6 libs/ui/kis_clipboard.h https://invent.kde.org/graphics/krita/commit/ad2bbd1f67d13c3deea35c1cdf29ac7fada2b1a7
Git commit 057b6e89adb9c19f010d31dfc6aa9694401ae54e by L. E. Segovia. Committed on 02/07/2022 at 00:51. Pushed by lsegovia into branch 'krita/5.1'. Give new single-layer pastes a default name (cherry picked from commit 3706f1d50cd0b617f6180ae1425d001e47c8e26c) M +5 -1 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/057b6e89adb9c19f010d31dfc6aa9694401ae54e
Git commit 951a8211c4e98b6aa4d2c392378e9ca7e46203b0 by L. E. Segovia. Committed on 02/07/2022 at 00:51. Pushed by lsegovia into branch 'krita/5.1'. KisClipboard: decouple source selection and allow for manual import of single URLs (cherry picked from commit ad2bbd1f67d13c3deea35c1cdf29ac7fada2b1a7) M +153 -42 libs/ui/KisView.cpp M +43 -10 libs/ui/kis_clipboard.cc M +14 -6 libs/ui/kis_clipboard.h https://invent.kde.org/graphics/krita/commit/951a8211c4e98b6aa4d2c392378e9ca7e46203b0