Bug 294602 - Sub sub-folders separated with '/' in file path cannot be created with album selection dialog [patch]
Summary: Sub sub-folders separated with '/' in file path cannot be created with album ...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Unclassified
Component: Import-Albums (show other bugs)
Version: 3.0.0
Platform: Ubuntu Packages Linux
: NOR normal with 85 votes (vote)
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 09:26 UTC by Mathieu MD
Modified: 2017-08-16 09:34 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.6.0


Attachments
Error popup (50.77 KB, image/png)
2012-02-22 09:27 UTC, Mathieu MD
Details
Implement subfolder creation for albums (1.51 KB, patch)
2014-11-24 14:38 UTC, Jimmy Axenhus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu MD 2012-02-22 09:26:35 UTC
Version:           2.5.0 (using KDE 4.8.0) 
OS:                Linux

I prefer to organize my folders (=albums) by date: Album_root/2012/02/22/photo.jpg

So when I import photos, it would be helpful if the subfolders (02 and 22) could be created automatically according to the EXIF date.

Reproducible: Always

Steps to Reproduce:
1) Launch the Import Tool
2) Select photos
3) Check the "Date-based sub-albums" and set a Date format to "yyyy/MM/dd"
4) Click on the download button
5) A popup ask when you want to import the photo
6) Choose the album root folder

Actual Results:  
An error popup says:
Album name cannot contain '/'.
(see attached capture)

Expected Results:  
The subfolders needed by the imported photo should be created silently and corresponding photos imported into them.

OS: Linux (i686) release 3.2.0-17-generic-pae
Compiler: gcc
Comment 1 Mathieu MD 2012-02-22 09:27:09 UTC
Created attachment 68999 [details]
Error popup
Comment 2 xstej70 2012-08-29 18:12:22 UTC
I too would like to use "yyyy/MM".
Comment 3 howerkraft 2012-11-22 18:23:08 UTC
I would like too see this too.
Comment 4 caulier.gilles 2012-11-22 20:36:38 UTC
As we have re-written a lots of code in Import tool this summer through GoSC 2012, The entry must be checked again with current digiKam 3.0.0-beta3 (not yet stable), at least to perform regression tests.

Gilles Caulier
Comment 5 xstej70 2012-11-23 08:31:27 UTC
Hello Gilles,

I've just tested it with 3.0.0-beta3 and the error is still the same as in the attached example.
Comment 6 xstej70 2013-02-12 17:23:10 UTC
I've just tested version 3.0.0 and the popup is the same.
Comment 7 ianp 2013-05-14 07:09:54 UTC
Still a problem in release 3.0.
This folder structure is automatically created in Shotwell, Rapid Downloader, Picasa and others. People moving to Digikam from these want to maintain their structure.

See also:
http://sourceforge.net/tracker/?func=detail&aid=3610922&group_id=42641&atid=433763
Comment 8 caulier.gilles 2013-05-14 07:13:54 UTC
Please report this sourceforge bug details in KDE bugzilla. We NEVER use SFbugtracker...

Gilles Caulier
Comment 9 ianp 2013-05-14 07:17:18 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Alan 2013-05-14 08:43:33 UTC
As a workaround until this gets fixed, you can actually make the import work by:
1. Create the empty folders tree in advance (by script or by hand)
2. Use double forward slash in the Check the Date format, e.g. to "yyyy//MM//dd"

Hope this helps ease the pain.
Comment 11 Teemu Rytilahti 2013-12-05 01:03:13 UTC
*** Bug 298035 has been marked as a duplicate of this bug. ***
Comment 12 Teemu Rytilahti 2013-12-05 01:03:30 UTC
My comment from the another bug: Starting point for fixing this would be ImportUI::createSubAlbum(KUrl& downloadUrl, const QString& subalbum, const QDate& date) or createAutoAlbum() in the same class, in case support for folders should be wanted.
Comment 13 Henrique Santos Fernandes 2014-06-08 21:36:44 UTC
I am using digikam 4.0.0

I have the same "problem"

When i import images, i wont it to be organized like this:

[Folder of year ] / [Folder of month] / [Folder of day ] / [ Picture of the day] 

An example would be like this:
Took a picture 2014-12-25 named picture1.jpeg

When i import the files i want it to be store in my albuns like this:

/home/user/album/2014/12/25/picture1.jpeg

As explained in the description:

Reproducible: Always

Steps to Reproduce:
1) Launch the Import Tool
2) Select photos
3) Check the "Date-based sub-albums" and set a Date format to "yyyy/MM/dd"
4) Click on the download button
5) A popup ask when you want to import the photo
6) Choose the album root folder

Actual Results:  
An error popup says:
Album name cannot contain '/'.
(see attached capture)

Expected Results:  
The subfolders needed by the imported photo should be created silently and corresponding photos imported into them.

And as explained by Alan:

As a workaround until this gets fixed, you can actually make the import work by:
1. Create the empty folders tree in advance (by script or by hand)
2. Use double forward slash in the Check the Date format, e.g. to "yyyy//MM//dd"

But i guess is not pretty to have to create manually the folder to make it work

So i guess would not be hard to fix, just check if there is a '/' and create folders if it does not exists.

Thanks
Comment 14 Jimmy Axenhus 2014-11-24 14:38:58 UTC
Created attachment 89714 [details]
Implement subfolder creation for albums

Here's a patch that implements the exact functionality requested. This is my first patch to the KDE bugtracker.
Comment 15 Teemu Rytilahti 2014-12-05 14:50:12 UTC
Git commit c28cd005a979aa4c3731c183ec6376707c10d5a8 by Teemu Rytilahti.
Committed on 05/12/2014 at 14:49.
Pushed by rytilahti into branch 'master'.

ImportUI: Allow creation of subfolder when importing by creating parents recursively.

Thanks for the patch Jimmy!

M  +2    -1    NEWS
M  +21   -4    utilities/importui/main/importui.cpp

http://commits.kde.org/digikam/c28cd005a979aa4c3731c183ec6376707c10d5a8