Summary: | Rename images according to Exif date instead of file date [patch] | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | pochini |
Component: | Import-PostProcessing | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andi.clemens, caulier.gilles, david.varnes, thomas.bettler, wazery |
Priority: | NOR | ||
Version: | 3.1.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 7.6.0 | |
Sentry Crash Report: | |||
Attachments: | Rename images according to photo (exif) date |
Description
pochini
2012-09-23 08:27:30 UTC
Created attachment 74106 [details]
Rename images according to photo (exif) date
This patch fixes the problem I reported.
Patch seems to be ok, I will apply it... I'm unable to apply the patch because the import tool doesn't use the custom renaming option anymore? The option is broken... Someone seems to have changed the tool and removed the custom renaming option... I will check with "git blame".... I hope these errors are not present in the current digiKam release... the import tool was not able to be used due to nullpointer exceptions, and now it doesn't seem to work correctly... If I remove the function RenameCustomizer::newName() and RenameCustomizer::renameManager(), digiKam still compiles. This can not be right. At least one of these methods must be used to get the new name for imported images. Andi, it's probably due to changes from Islam in Import tool revamp project. I CC him for info... Gilles My patch is incomplete. It fixes only the names of the photos which have been loaded (at least their thumbnails). The name get fixed only when the icon is selected while it is visible. If I press ctrl-a, then I scroll down the list, the names of the newly exposed icons are wrong. Once a photo is assigned the right name, it stays. When AdvancedRenameManager::addFile() is called for a file which hasn't been loaded yet datetime.toTime_t() is -1. I'm not sure how to fix this issue... Are you sure you are calling AdvancedRenameManager::addFile()? This method is private and should not be accessible. This is the backtrace: #1 0x00000000006b97ca in Digikam::AdvancedRenameManager::addFiles (this=0x4b8bd80, files=<optimized out>) at /home/giu/apps/digikam-2.9.0/core/utilities/advancedrename/advancedrenamemanager.cpp:281 #2 0x00000000007b237f in Digikam::CameraIconView::slotUpdateDownloadNames (this=0x32eacf0, hasSelection=true) at /home/giu/apps/digikam-2.9.0/core/utilities/cameragui/views/cameraiconview.cpp:481 #3 0x00007ffff25f45f1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4 #4 0x00000000007acfe0 in Digikam::CameraIconView::signalNewSelection (this=<optimized out>, _t1=true) at /home/giu/apps/digikam-2.9.0/build/core/utilities/cameragui/cameraiconview.moc:223 #5 0x00000000007ad509 in Digikam::CameraIconView::slotSelectionChanged (this=0x32eacf0) at /home/giu/apps/digikam-2.9.0/core/utilities/cameragui/views/cameraiconview.cpp:586 #6 0x00007ffff25f45f1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4 #7 0x000000000078a59a in Digikam::IconView::selectItem (this=0x32eacf0, item=0x4c20590, select=<optimized out>) at /home/giu/apps/digikam-2.9.0/core/utilities/cameragui/q3support/iconview.cpp:500 #8 0x00000000007bfbec in Digikam::IconItem::setSelected (this=0x4c20590, val=true, cb=true) at /home/giu/apps/digikam-2.9.0/core/utilities/cameragui/q3support/iconitem.cpp:186 #9 0x0000000000789d10 in Digikam::IconView::slotRearrange (this=0x32eacf0) at /home/giu/apps/digikam-2.9.0/core/utilities/cameragui/q3support/iconview.cpp:827 #10 0x00007ffff25f45f1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4 #11 0x00007ffff25f94e9 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4 #12 0x00007ffff14f2a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4 #13 0x00007ffff14f78f3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4 #14 0x00007ffff32e0f46 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5 #15 0x00007ffff25e086c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4 #16 ... I simply added in AdvancedRenameManager::addFile(const QString& filename, const QDateTime& datetime) a printf("%d %s\n", datetime.toTime_t(), filename.ascii()) which shows that datetime is -1 the first time the thumbnail are loaded and displayed. When I click on a thumbnail something updates datetime and it prints the correct value of that thumbnail. Islam, is this regression fixed for the final release? In the ImportUI, I see d->renameCustomizer being created and added to the UI. But the line d->view->setRenameCustomizer() is commented out => how does the view compute the adjusted names? When computing the download name, starting from line 1685, the renameCustomizer is not asked. The source could be the downloadUrl retrieved from the view (I believe it was previously, but not a clean solution) but the renameCustomizer is not asked here as well. No response from Islam. Andi, can you give some guidance what would be the right lines of code to retrieve a name from the RenameCustomizer? Andi, This file can be considerated as fixed since you close bug #312433 ? Gilles Caulier No I don't think so, the custom names are still not working. I had not yet the time to look into this, so it definitely isn't fixed at the moment. Git commit 7f3459d55dd453f257ece35398175bba22ea4109 by Gilles Caulier. Committed on 25/01/2015 at 11:39. Pushed by cgilles into branch 'master'. Apply patch #90637 from Maik Qualmann to fix image renaming settings rules in Import Tool to work properly while downloading. Related: bug 342996, bug 314441, bug 329438, bug 342430 FIXED-IN: 4.7.0 M +3 -1 NEWS M +2 -2 utilities/importui/backend/cameracontroller.cpp M +67 -44 utilities/importui/main/importui.cpp M +1 -0 utilities/importui/main/importui.h M +5 -0 utilities/importui/views/importview.cpp M +1 -0 utilities/importui/views/importview.h http://commits.kde.org/digikam/7f3459d55dd453f257ece35398175bba22ea4109 Git commit 0201e6fc8549ac849029daf36eaeadd6ebb4d4ae by Gilles Caulier. Committed on 25/01/2015 at 13:58. Pushed by cgilles into branch 'frameworks'. Backport commit #7f3459d55dd453f257ece35398175bba22ea4109 from git/master to frameworks branch. Related: bug 342996, bug 314441, bug 329438, bug 342430 M +3 -3 utilities/importui/backend/cameracontroller.cpp M +74 -50 utilities/importui/main/importui.cpp M +1 -0 utilities/importui/main/importui.h M +5 -0 utilities/importui/views/importview.cpp M +1 -0 utilities/importui/views/importview.h http://commits.kde.org/digikam/0201e6fc8549ac849029daf36eaeadd6ebb4d4ae |