Bug 131284 - CD archiving writes faulty k3b project files
Summary: CD archiving writes faulty k3b project files
Status: RESOLVED UNMAINTAINED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-Archive (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-24 10:45 UTC by Stefan Brüns
Modified: 2017-08-18 13:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2006-07-24 10:45:50 UTC
Version:           0.8.1 (using KDE KDE 3.5.3)
Installed from:    SuSE RPMs

When exporting albums with images selected by tag, digikam may write k3b project files with the same filename for images coming from different albums.

To reproduce, create two albums (e.g. "a" and "b"), put an image "test.jpg" into both of them, give both the same tag, for example "duplitate_test", and archive to cd using this tag.

The resulting k3b project file will have somthing like
<file url="<path>/a/test.jpg>test.jpg</file>
<file url="<path>/b/test.jpg>test.jpg</file>
in it. As a result, k3b will hang indefinitely.
Comment 1 Angelo Naselli 2006-07-24 12:28:51 UTC
Just a curiosity, does html export work well in such a situation?
Comment 2 Angelo Naselli 2006-07-30 17:12:44 UTC
SVN commit 567902 by anaselli:

BUG: 131284

 M  +70 -44    cdarchiving.cpp  
 M  +5 -2      cdarchiving.h  
Comment 3 Angelo Naselli 2006-07-30 19:43:20 UTC
SVN commit 567951 by anaselli:

CCBUG: 131284
Fixed the case in which under the same tag there are two files with similar name but some upper case letters using HTML interface.

 M  +7 -2      cdarchiving.cpp  


--- trunk/extragear/libs/kipi-plugins/cdarchiving/cdarchiving.cpp #567950:567951
@@ -790,7 +790,7 @@
             ++urlIt)
     {
        QFileInfo imInfo( (*urlIt).fileName());
-       QString   imgName = makeFileNameUnique(fileNameList, imInfo.baseName(TRUE));
+       QString   imgName = makeFileNameUnique(fileNameList, webifyFileName(imInfo.baseName(TRUE)));
     }
     for( KURL::List::iterator urlIt = images.begin() ; 
          !m_cancelled && (urlIt != images.end());
@@ -1690,6 +1690,7 @@
    KURL::List images = collection.images();
    kdDebug( 51000 ) << "   Files: " << images.size() << endl;
    QStringList fileNameList;
+   QString fName;
    for (KURL::List::iterator it = images.begin();
         (it != images.end()) && !m_cancelled;
         ++it)
@@ -1697,8 +1698,12 @@
 
        kdDebug( 51000 ) << "   Filename: " << (*it).fileName() << endl;
        QFileInfo fInfo((*it).fileName());
-       QString fName = makeFileNameUnique(fileNameList, fInfo.baseName(TRUE)) 
+       if (m_useHTMLInterface)
+         fName = makeFileNameUnique(fileNameList, webifyFileName(fInfo.baseName(TRUE))) 
               + "." + fInfo.extension( FALSE );
+       else
+         fName = makeFileNameUnique(fileNameList, fInfo.baseName(TRUE)) 
+              + "." + fInfo.extension( FALSE );
        kdDebug( 51000 ) << "   Unique filename: " << fName  << endl;
        kdDebug( 51000 ) << "num of unique files: "<< fileNameList.size() << endl;