Bug 130547 - automatically download RAW-images into separate folder below the JPG-images
Summary: automatically download RAW-images into separate folder below the JPG-images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-PostProcessing (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-10 08:57 UTC by Thomas Reitelbach
Modified: 2017-08-16 06:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Reitelbach 2006-07-10 08:57:38 UTC
Version:           0.8.2-rc1 (using KDE 3.5.3, Debian Package 4:3.5.3-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-1-686-smp

Hello digikam devs :)

my camera usually records 2 pictures at once when i take a photo:
1x JPEG
1x RAW

When i download the pictures onto my computer, i usually create a new album and a subalbum for the RAW pictures.
Unfortunately digikam is not able to automatically download RAW pictures into a separate folder. in addition i'ts not possible in the digikam GUI to select/deselect special kind of photos with a filter like "*.CR2".
Comment 1 caulier.gilles 2006-08-25 16:42:58 UTC
SVN commit 577087 by cgilles:

digiKam from trunk : Camera Gui improvements : new option to download pictures into files 'Auto-created Extension-based sub-albums'. You can separate RAW, JPEG, MOV files easily in your destination album.

Note : you can use this options at the same time than 'Auto-created Date-based sub-albums' option. You will have something like this :

- 2006-03-24/JPG
- 2006-03-24/CR2
- 2006-03-24/MOV
etc...

BUG: 130547

 M  +74 -53    cameraui.cpp  


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #577086:577087
@@ -121,33 +121,34 @@
 
     CameraUIPriv()
     {
-        busy              = false;
-        closed            = false;
-        helpMenu          = 0;
-        advBox            = 0;
-        downloadMenu      = 0;
-        deleteMenu        = 0;
-        imageMenu         = 0;
-        cancelBtn         = 0;
-        splitter          = 0;
-        rightSidebar      = 0;
-        fixDateTimeCheck  = 0;
-        autoRotateCheck   = 0;
-        autoAlbumCheck    = 0;
-        status            = 0;
-        progress          = 0;
-        controller        = 0;
-        view              = 0;
-        renameCustomizer  = 0;
-        anim              = 0;
-        dateTimeEdit      = 0;
-        setPhotographerId = 0;
-        setCredits        = 0;
-        losslessFormat    = 0;
-        convertJpegCheck  = 0;
-        formatLabel       = 0;
-        folderDateLabel   = 0;
-        folderDateFormat  = 0;
+        busy               = false;
+        closed             = false;
+        helpMenu           = 0;
+        advBox             = 0;
+        downloadMenu       = 0;
+        deleteMenu         = 0;
+        imageMenu          = 0;
+        cancelBtn          = 0;
+        splitter           = 0;
+        rightSidebar       = 0;
+        fixDateTimeCheck   = 0;
+        autoRotateCheck    = 0;
+        autoAlbumDateCheck = 0;
+        autoAlbumExtCheck  = 0;
+        status             = 0;
+        progress           = 0;
+        controller         = 0;
+        view               = 0;
+        renameCustomizer   = 0;
+        anim               = 0;
+        dateTimeEdit       = 0;
+        setPhotographerId  = 0;
+        setCredits         = 0;
+        losslessFormat     = 0;
+        convertJpegCheck   = 0;
+        formatLabel        = 0;
+        folderDateLabel    = 0;
+        folderDateFormat   = 0;
     }
 
     bool                          busy;
@@ -168,7 +169,8 @@
     QWidget                      *advBox;
 
     QCheckBox                    *autoRotateCheck;
-    QCheckBox                    *autoAlbumCheck;
+    QCheckBox                    *autoAlbumDateCheck;
+    QCheckBox                    *autoAlbumExtCheck;
     QCheckBox                    *fixDateTimeCheck;
     QCheckBox                    *setPhotographerId;
     QCheckBox                    *setCredits;
@@ -254,17 +256,21 @@
         
     // -- Albums Auto-creation options -----------------------------------------
 
-    QVGroupBox* albumBox = new QVGroupBox(i18n("Auto-creation of Albums"), d->advBox);
-    d->autoAlbumCheck    = new QCheckBox(i18n("Date-based sub-albums"), albumBox);
-    QHBox *hbox1         = new QHBox(albumBox);
-    d->folderDateLabel   = new QLabel(i18n("Date format:"), hbox1);
-    d->folderDateFormat  = new QComboBox(hbox1);
+    QVGroupBox* albumBox  = new QVGroupBox(i18n("Auto-creation of Albums"), d->advBox);
+    d->autoAlbumExtCheck  = new QCheckBox(i18n("Extension-based sub-albums"), albumBox);
+    d->autoAlbumDateCheck = new QCheckBox(i18n("Date-based sub-albums"), albumBox);
+    QHBox *hbox1          = new QHBox(albumBox);
+    d->folderDateLabel    = new QLabel(i18n("Date format:"), hbox1);
+    d->folderDateFormat   = new QComboBox(hbox1);
     d->folderDateFormat->insertItem(i18n("ISO"),            CameraUIPriv::IsoDateFormat);
     d->folderDateFormat->insertItem(i18n("Full Text"),      CameraUIPriv::TextDateFormat);
     d->folderDateFormat->insertItem(i18n("Local Settings"), CameraUIPriv::LocalDateFormat);
 
-    QWhatsThis::add( d->autoAlbumCheck, i18n("<p>Toogle on this option if you want downloaded photos "
-                     "into automatically created date-based sub-albums of destination album."));
+    QWhatsThis::add( d->autoAlbumExtCheck, i18n("<p>Toogle on this option if you want to download your pictures "
+                     "into automatically created file extension-based sub-albums of destination album. "
+                     "By this way, you can separate JPEG and RAW files from your camera."));
+    QWhatsThis::add( d->autoAlbumDateCheck, i18n("<p>Toogle on this option if you want to download your pictures "
+                     "into automatically created file date-based sub-albums of destination album."));
     QWhatsThis::add( d->folderDateFormat, i18n("<p>Select here your prefered date format used to "
                      "create new albums. The options available are:<p>"
                      "<b>ISO</b>: the date format is in accordance with ISO 8601 "
@@ -399,10 +405,10 @@
 
     // -------------------------------------------------------------------------
     
-    connect(d->autoAlbumCheck, SIGNAL(toggled(bool)),
+    connect(d->autoAlbumDateCheck, SIGNAL(toggled(bool)),
             d->folderDateFormat, SLOT(setEnabled(bool)));
 
-    connect(d->autoAlbumCheck, SIGNAL(toggled(bool)),
+    connect(d->autoAlbumDateCheck, SIGNAL(toggled(bool)),
             d->folderDateLabel, SLOT(setEnabled(bool)));
 
     connect(d->convertJpegCheck, SIGNAL(toggled(bool)),
@@ -529,7 +535,8 @@
     KConfig* config = kapp->config();
     config->setGroup("Camera Settings");
     d->autoRotateCheck->setChecked(config->readBoolEntry("AutoRotate", true));
-    d->autoAlbumCheck->setChecked(config->readBoolEntry("AutoAlbum", false));
+    d->autoAlbumDateCheck->setChecked(config->readBoolEntry("AutoAlbumDate", false));
+    d->autoAlbumExtCheck->setChecked(config->readBoolEntry("AutoAlbumExt", false));
     d->fixDateTimeCheck->setChecked(config->readBoolEntry("FixDateTime", false));
     d->setPhotographerId->setChecked(config->readBoolEntry("SetPhotographerId", false));
     d->setCredits->setChecked(config->readBoolEntry("SetCredits", false));
@@ -546,8 +553,8 @@
     d->dateTimeEdit->setEnabled(d->fixDateTimeCheck->isChecked());
     d->losslessFormat->setEnabled(convertLosslessJpegFiles());
     d->formatLabel->setEnabled(convertLosslessJpegFiles());
-    d->folderDateFormat->setEnabled(d->autoAlbumCheck->isChecked());
-    d->folderDateLabel->setEnabled(d->autoAlbumCheck->isChecked());
+    d->folderDateFormat->setEnabled(d->autoAlbumDateCheck->isChecked());
+    d->folderDateLabel->setEnabled(d->autoAlbumDateCheck->isChecked());
 
     resize(configDialogSize("Camera Settings"));
 }
@@ -559,7 +566,8 @@
     KConfig* config = kapp->config();
     config->setGroup("Camera Settings");
     config->writeEntry("AutoRotate", d->autoRotateCheck->isChecked());
-    config->writeEntry("AutoAlbum", d->autoAlbumCheck->isChecked());
+    config->writeEntry("AutoAlbumDate", d->autoAlbumDateCheck->isChecked());
+    config->writeEntry("AutoAlbumExt", d->autoAlbumExtCheck->isChecked());
     config->writeEntry("FixDateTime", d->fixDateTimeCheck->isChecked());
     config->writeEntry("SetPhotographerId", d->setPhotographerId->isChecked());
     config->writeEntry("SetCredits", d->setCredits->isChecked());
@@ -1045,7 +1053,7 @@
     }
 
     album = AlbumSelectDialog::selectAlbum(this, (PAlbum*)album, header, newDirName,
-                                           d->autoAlbumCheck->isChecked());
+                                           d->autoAlbumDateCheck->isChecked());
 
     if (!album)
         return;
@@ -1095,12 +1103,15 @@
         mtime                        = iconItem->itemInfo()->mtime;
         
         KURL u(url);
-        
-        if (d->autoAlbumCheck->isChecked())
+        QString errMsg;
+        QDateTime dateTime;
+        dateTime.setTime_t(mtime);
+                    
+        // Auto sub-albums creation based on file date.     
+
+        if (d->autoAlbumDateCheck->isChecked())
         {
-            QDateTime dateTime;
-            dateTime.setTime_t(mtime);
-            QString dirName;;
+            QString dirName;
 
             switch(d->folderDateFormat->currentItem())
             {
@@ -1115,7 +1126,6 @@
                     break;
             }
 
-            QString errMsg;
             if (!createAutoAlbum(url, dirName, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
@@ -1123,15 +1133,26 @@
             }
 
             u.addPath(dirName);
-            d->foldersToScan.append(u.path());
-            u.addPath(downloadName.isEmpty() ? downloadSettings.file : downloadName);
         }
-        else
+
+        // Auto sub-albums creation based on File extensions to store items in separate folders.
+
+        if (d->autoAlbumExtCheck->isChecked())           
         {
-            d->foldersToScan.append(u.path());
-            u.addPath(downloadName.isEmpty() ? downloadSettings.file : downloadName);
+            QFileInfo fi(downloadSettings.file);
+
+            if (!createAutoAlbum(u, fi.extension().upper(), dateTime.date(), errMsg))
+            {
+                KMessageBox::error(this, errMsg);
+                return;
+            }
+
+            u.addPath(fi.extension().upper());
         }
 
+        d->foldersToScan.append(u.path());
+        u.addPath(downloadName.isEmpty() ? downloadSettings.file : downloadName);
+
         downloadSettings.dest = u.path();
 
         d->controller->download(downloadSettings);
Comment 2 Thomas Reitelbach 2006-08-25 18:01:23 UTC
This is cool, i'll have to update my SVN copy immediately :)))

thank you very much!