Bug 424934 - Making an album a part of itself will fill the hard-drive with copies of itself
Summary: Making an album a part of itself will fill the hard-drive with copies of itself
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Albums (show other bugs)
Version: 7.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-02 16:15 UTC by HJN
Modified: 2020-08-04 19:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.1.0


Attachments
Windows Explorer picture jpg (440.02 KB, image/jpeg)
2020-08-02 16:15 UTC, HJN
Details
pic 1 (104.53 KB, image/png)
2020-08-03 20:35 UTC, HJN
Details
pic 2 (137.84 KB, image/png)
2020-08-03 20:35 UTC, HJN
Details
pic 3 (130.14 KB, image/png)
2020-08-03 20:35 UTC, HJN
Details
pic 4 (130.14 KB, image/png)
2020-08-03 20:36 UTC, HJN
Details
pic 5 (270.20 KB, image/png)
2020-08-03 20:36 UTC, HJN
Details
pic 6 (247.41 KB, image/png)
2020-08-03 20:37 UTC, HJN
Details
pic 7 (247.73 KB, image/png)
2020-08-03 20:37 UTC, HJN
Details
pic 8 (148.34 KB, image/png)
2020-08-03 20:37 UTC, HJN
Details

Note You need to log in before you can comment on or make changes to this bug.
Description HJN 2020-08-02 16:15:35 UTC
Created attachment 130583 [details]
Windows Explorer picture jpg

SUMMARY
If you make a new database and place that inside a folder (directory) and let's call that folder: One.

You can then make an album inside that folder. Let's call that album: Two. This album becomes a folder itself in windows explorer, called: Two.

Inside that album you can import a folder. If that folder, is the parent album folder, it will make copy after copy after copy of itself, inside itself.

If the folder you wish to import is the folder called: One, it will make copy after copy of everything inside the datebase folder (including every other album you have made) until the hard-drive is filled up.

STEPS TO REPRODUCE
1. Make a new database inside a folder.
2. Make a new album inside another folder, inside the first folder.
3. Import a third folder into the album, but make that folder either the album folder itself or the database folder.

OBSERVED RESULT
From inside the program, Nothing.
From inside Windows Explorer, a lot of files and folders being copied inside folder after folder. 

EXPECTED RESULT
From inside the program, a warning saying: Are you nuts?

SOFTWARE/OS VERSIONS
Windows: 10 build: 18363.959
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2020-08-03 11:39:19 UTC
I don't understand how you import the folder for this problem to occur. The digiKam import tool only imports images, no folders only for special options (date folder).

Maik
Comment 2 Maik Qualmann 2020-08-03 11:45:02 UTC
I see the "Arbeitsmappe" folder - is that a virtual folder? I think so. We do not support or plan virtual folders. You have to create your image collection in a real folder.

Maik
Comment 3 HJN 2020-08-03 20:13:45 UTC
(In reply to Maik Qualmann from comment #1)
> I don't understand how you import the folder for this problem to occur. The
> digiKam import tool only imports images, no folders only for special options
> (date folder).
> 
> Maik

Yeah. You should not make a bug repport when you are in a hurry and tired.

Let me try to explain again and I have made pictures to help.

1. In digiKam toolbar, open "Settings" > "Configure digiKam".
2. In the dialogbox, click "Collections" > Add Collection"
3. Select a folder and make it an Album (is it an collection or an album?)
4. Click "Import" in the toolbar and open the "Add Folders" dialog box.
5. Select the same folder you just made as an Album.
6. Save the folder into the album you just made.
7. Open Windows Exploror and navigate to the folder you made as an album.
8. Inside that folder, you should now find the "parent folder" to the "album folder". This parent folder contains the "album folder", which again contains the "parent folder" etc etc.
9. Close digiKam to stop the process from running wild.
(you can open digiKam later without it starting the prosess again).
Comment 4 HJN 2020-08-03 20:22:15 UTC
(In reply to Maik Qualmann from comment #2)
> I see the "Arbeitsmappe" folder - is that a virtual folder? I think so. We
> do not support or plan virtual folders. You have to create your image
> collection in a real folder.
> 
> Maik

"Arbeitsmappe" is Danish for "Work folder".
It is a folder I made under the "Users" > "username" folder in Windows.
My pc is set up to let Onedrive backup my pc on the run.
I have all my pictures stored on a NAT-drive and when I want to edit them, I put them in the "Arbejdsmappe" as it is NOT part of the Onedrive backup.
So not a vitual folder.
Comment 5 HJN 2020-08-03 20:35:15 UTC
Created attachment 130610 [details]
pic 1
Comment 6 HJN 2020-08-03 20:35:40 UTC
Created attachment 130611 [details]
pic 2
Comment 7 HJN 2020-08-03 20:35:59 UTC
Created attachment 130612 [details]
pic 3
Comment 8 HJN 2020-08-03 20:36:20 UTC
Created attachment 130613 [details]
pic 4
Comment 9 HJN 2020-08-03 20:36:40 UTC
Created attachment 130614 [details]
pic 5
Comment 10 HJN 2020-08-03 20:37:02 UTC
Created attachment 130615 [details]
pic 6
Comment 11 HJN 2020-08-03 20:37:25 UTC
Created attachment 130616 [details]
pic 7
Comment 12 HJN 2020-08-03 20:37:46 UTC
Created attachment 130617 [details]
pic 8
Comment 13 Maik Qualmann 2020-08-03 21:10:38 UTC
Git commit a03233dc15968d2a04eb10ebf715389f3a7901fd by Maik Qualmann.
Committed on 03/08/2020 at 21:09.
Pushed by mqualmann into branch 'master'.

check the folders to be imported, with existing collections
FIXED-IN: 7.1.0

M  +2    -2    NEWS
M  +12   -0    core/app/main/digikamapp_import.cpp
M  +1    -0    core/app/main/digikamapp_p.h

https://invent.kde.org/graphics/digikam/commit/a03233dc15968d2a04eb10ebf715389f3a7901fd
Comment 14 Maik Qualmann 2020-08-03 21:40:51 UTC
Note: Many new Windows users think they have to import images to digiKam. This is not the case. A parent folder with images can be selected directly in the collection settings. DigiKam automatically reads in all images and subfolders. No images are changed or additional folders or files are created.

Maik
Comment 15 HJN 2020-08-04 16:23:52 UTC
I don't think it is polite to call people that submit bugs, for noobs, just be course they use the Windows platform.
You have no idea how many years I've been on this platform. You also don't know how I use your program to fit my working style.
I try to use programs in ways, you would not imagine, that is why I find bugs.
This bug by accident, as I clicked the wrong folder.

That out of the way. I'm not a programmer, so please tell me if I'm wrong.
To me it looks like the fix you have implemented, is that the program looks for the name* of the folder being imported, and if that name* is already listed  as an album, the program will give the user an error message.
* by name I mean folder path.

But does it also give the error message if you import a parent folder further up the path?
Let's say you have your "Picture folder", and inside that folder you have other folders, one of which you make an album.
If you now, by accident, import the "Picture folder", you will get the bug.
Does the fix stop that?

The "Picture folder" is part of the user[name] path, so if you import the user[name] folder, will it stop the bug from happening?
* user[name] folder is as far back I have been able to make the bug happen.

Don't get me wrong. I'm not trying to imply you can't fix it.
I'm just trying to make sure this bug gets the attention it needs, course it is pretty severe.
Comment 16 caulier.gilles 2020-08-04 16:33:40 UTC
HJN,

No, Maik do not want to offence you because you use Windows.

... but in general, Linux programmer know all the computer shell, where under Windows, all is hidden. This is why the approach of the problem is different, more technical, and follow a logic which can be obscure for no programmer.

We are all here to improve the code, the functionalities, and kill the bugs. digiKam is a huge application with around 20 years of development, and 1.5 M lines of C++ code. It's impossible to test all use-cases.

Best

Gilles Caulier
Comment 17 Maik Qualmann 2020-08-04 17:43:22 UTC
Don't get me wrong, it may also be due to my bad English, they weren't meant personally. We often ask users if they want to import a collection, so a generic note if we refer to this bug report. Your bug report was even a duplicate because I didn't understand what the user was doing. Your explanation has brought enlightenment. You have to know that I have never used this function myself. ((:-))
And yes, subfolders selections are also recognized.

Maik
Comment 18 Maik Qualmann 2020-08-04 18:57:22 UTC
Git commit 5d8cb554c8680b1c3cc254082deaa5fb26a434f2 by Maik Qualmann.
Committed on 04/08/2020 at 18:56.
Pushed by mqualmann into branch 'master'.

check for the album root path,
to enable import from other collections.

M  +13   -12   core/app/main/digikamapp_import.cpp
M  +0    -1    core/app/main/digikamapp_p.h

https://invent.kde.org/graphics/digikam/commit/5d8cb554c8680b1c3cc254082deaa5fb26a434f2
Comment 19 HJN 2020-08-04 19:41:58 UTC
No hard feelings from here.
English is not my first language either, so it may have been me that misunderstood. My bad. Sorry.

No, I don't have a master folder with all my pictures, which I can use as a collection. That is why I wanted to import other folders, maybe even form another hard drive.

Must say you work fast, fixing bugs submitted.
For that I give you a 10 / 10

I now consider this bug closed.