<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>307253</bug_id>
          
          <creation_ts>2012-09-23 08:27:30 +0000</creation_ts>
          <short_desc>Rename images according to Exif date instead of file date [patch]</short_desc>
          <delta_ts>2022-01-26 11:42:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>digikam</product>
          <component>Import-PostProcessing</component>
          <version>3.1.0</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>pochini</reporter>
          <assigned_to name="Digikam Developers">digikam-bugs-null</assigned_to>
          <cc>andi.clemens</cc>
    
    <cc>caulier.gilles</cc>
    
    <cc>david.varnes</cc>
    
    <cc>thomas.bettler</cc>
    
    <cc>wazery</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin>7.6.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>20</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1299716</commentid>
    <comment_count>0</comment_count>
    <who name="">pochini</who>
    <bug_when>2012-09-23 08:27:30 +0000</bug_when>
    <thetext>Digkam has options to rename files while importing them. The problem is that the &quot;[date]&quot; option expands to the date/time of the file. This has the annoying side effect of making the file names all wrong for files which have been copied. Furthermore, when the camera is configured to save both raw and jpg, files have a different mtime, so the two versions of the same image end up having different names.

Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1299717</commentid>
    <comment_count>1</comment_count>
      <attachid>74106</attachid>
    <who name="">pochini</who>
    <bug_when>2012-09-23 08:29:44 +0000</bug_when>
    <thetext>Created attachment 74106
Rename images according to photo (exif) date

This patch fixes the problem I reported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1300455</commentid>
    <comment_count>2</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2012-09-25 09:24:45 +0000</bug_when>
    <thetext>Patch seems to be ok, I will apply it...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1300468</commentid>
    <comment_count>3</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2012-09-25 10:16:45 +0000</bug_when>
    <thetext>I&apos;m unable to apply the patch because the import tool doesn&apos;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 &quot;git blame&quot;....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1300470</commentid>
    <comment_count>4</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2012-09-25 10:18:37 +0000</bug_when>
    <thetext>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&apos;t seem to work correctly...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1300472</commentid>
    <comment_count>5</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2012-09-25 10:21:43 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1300484</commentid>
    <comment_count>6</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2012-09-25 11:00:22 +0000</bug_when>
    <thetext>Andi, it&apos;s probably due to changes from Islam in Import tool revamp project. I CC him for info...

Gilles</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1302105</commentid>
    <comment_count>7</comment_count>
    <who name="">pochini</who>
    <bug_when>2012-10-01 22:16:59 +0000</bug_when>
    <thetext>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&apos;t been loaded yet datetime.toTime_t() is -1. I&apos;m not sure how to fix this issue...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1302869</commentid>
    <comment_count>8</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2012-10-04 12:14:50 +0000</bug_when>
    <thetext>Are you sure you are calling AdvancedRenameManager::addFile()? This method is private and should not be accessible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1303965</commentid>
    <comment_count>9</comment_count>
    <who name="">pochini</who>
    <bug_when>2012-10-07 15:09:12 +0000</bug_when>
    <thetext>This is the backtrace:

#1  0x00000000006b97ca in Digikam::AdvancedRenameManager::addFiles (this=0x4b8bd80, files=&lt;optimized out&gt;) 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=&lt;optimized out&gt;, _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=&lt;optimized out&gt;) 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&amp; filename, const QDateTime&amp; datetime) a printf(&quot;%d %s\n&quot;, 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1316020</commentid>
    <comment_count>10</comment_count>
    <who name="Marcel Wiesweg">marcel.wiesweg</who>
    <bug_when>2012-11-16 10:10:24 +0000</bug_when>
    <thetext>Islam, is this regression fixed for the final release?
In the ImportUI, I see d-&gt;renameCustomizer being created and added to the UI. 
But the line d-&gt;view-&gt;setRenameCustomizer() is commented out =&gt; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1322418</commentid>
    <comment_count>11</comment_count>
    <who name="Marcel Wiesweg">marcel.wiesweg</who>
    <bug_when>2012-12-09 12:58:04 +0000</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1328998</commentid>
    <comment_count>12</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2013-01-05 22:30:23 +0000</bug_when>
    <thetext>Andi,

This file can be considerated as fixed since you close bug #312433 ?

Gilles Caulier</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1329019</commentid>
    <comment_count>13</comment_count>
    <who name="Andi Clemens">andi.clemens</who>
    <bug_when>2013-01-05 23:37:31 +0000</bug_when>
    <thetext>No I don&apos;t think so, the custom names are still not working. I had not yet the time to look into this, so it definitely isn&apos;t fixed at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1494152</commentid>
    <comment_count>14</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2015-01-25 11:43:07 +0000</bug_when>
    <thetext>Git commit 7f3459d55dd453f257ece35398175bba22ea4109 by Gilles Caulier.
Committed on 25/01/2015 at 11:39.
Pushed by cgilles into branch &apos;master&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1494183</commentid>
    <comment_count>15</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2015-01-25 14:01:06 +0000</bug_when>
    <thetext>Git commit 0201e6fc8549ac849029daf36eaeadd6ebb4d4ae by Gilles Caulier.
Committed on 25/01/2015 at 13:58.
Pushed by cgilles into branch &apos;frameworks&apos;.

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</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>74106</attachid>
            <date>2012-09-23 08:29:44 +0000</date>
            <delta_ts>2012-09-23 08:29:44 +0000</delta_ts>
            <desc>Rename images according to photo (exif) date</desc>
            <filename>dk_rename_by_exif_date.patch</filename>
            <type>text/plain</type>
            <size>606</size>
            <attacher>pochini</attacher>
            
              <data encoding="base64">LS0tIGNvcmUvdXRpbGl0aWVzL2NhbWVyYWd1aS92aWV3cy9jYW1lcmFpY29udmlldy5jcHBfX29y
aWcJMjAxMi0wOS0wMiAxMjozNzo1NC4wMDAwMDAwMDAgKzAyMDAKKysrIGNvcmUvdXRpbGl0aWVz
L2NhbWVyYWd1aS92aWV3cy9jYW1lcmFpY29udmlldy5jcHAJMjAxMi0wOS0yMyAwODo1ODoyNi40
Mzk5NDIzNTYgKzAyMDAKQEAgLTQ3Myw3ICs0NzMsNyBAQCB2b2lkIENhbWVyYUljb25WaWV3Ojpz
bG90VXBkYXRlRG93bmxvYWROCiAgICAgICAgICAgICBmaS5zZXRGaWxlKFFEaXIodmlld0l0ZW0t
Pml0ZW1JbmZvKCkuZm9sZGVyKSwgdmlld0l0ZW0tPml0ZW1JbmZvKCkubmFtZSk7CiAgICAgICAg
ICAgICBQYXJzZVNldHRpbmdzIHBzOwogICAgICAgICAgICAgcHMuZmlsZVVybCAgICAgID0gS1Vy
bChmaS5hYnNvbHV0ZUZpbGVQYXRoKCkpOwotICAgICAgICAgICAgcHMuY3JlYXRpb25UaW1lID0g
dmlld0l0ZW0tPml0ZW1JbmZvKCkubXRpbWU7CisgICAgICAgICAgICBwcy5jcmVhdGlvblRpbWUg
PSB2aWV3SXRlbS0+aXRlbUluZm8oKS5waG90b0luZm8uZGF0ZVRpbWU7CiAgICAgICAgICAgICBj
YW1lcmFGaWxlcyA8PCBwczsKICAgICAgICAgfQogICAgIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>