[Digikam-devel] [Bug 193890] Update Time & Date: update "Modified" date

Mikolaj Machowski mikmach at wp.pl
Sun May 24 22:49:07 BST 2009


https://bugs.kde.org/show_bug.cgi?id=193890





--- Comment #3 from Mikolaj Machowski <mikmach wp pl>  2009-05-24 23:49:06 ---
Note: this is somewhat related to situation where indexable file doesn't have
EXIF data. In such situations modification date (system date) which is usually
real creation date may be earlier than digiKam creation date because in such
situation digiKam takes for creation date date of import to database. Related
fragments of mails from digikam-users:


Thomas (tzsnoopy):
since a few days I am using digiKam 0.10.0 and I have to say it is a
great piece of software!!
But now I am a bit confused about the dates shown in digiKam.

In the thumbnail view there are shown two dates below each image, the
creation date as well as the modification date. For all of my pictures
containing EXIF data the dates are like I would expect. But for movies
as well as images without EXIF data it's a bit confusing. There, the
modified date matches the date the movie was taken, but the creation
date seems to be not really related to the file. The sad thing for me is
that the creation date is used for the timeline and thus all my movies
appear at the wrong date.

Here an example:
PICT0003.mov
created: 12.08.2008 (I have no idea what I did with the file on this
day)
modified: 16.05.2004  (on this day the movie was taken)

The strange thing is that the date shown as "created" is not equal to
the mtime, ctime, or utime of the file (according to "ls -l", "ls -lc",
and "ls -lu").

So finally, here are my questions: 
- Where does the date that is taken as the creation date by digiKam come
from?
- And, is there any possibility to replace the date stored as "created"
by the date stored as "modified"? I have several hundred images and
movies without EXIF data, so adjusting the date for each image by hand
using the menu is not a real option.
------------------------------------------------------
And his final solution:

Still, I do not know where digikam gets the creation date from if there
is no metadata in the file. 
But "database" was a good hint. I could take the modifications dates
(which are in my case the real dates of taking the movies) and set them
as creation dates by directly modifying the digikam database.

For all people with a similar problem, here is the way I did it:
I opened the digikam database file (in my case: digikam4.db), which is a
sqlite database, with sqliteadmin running under wine. There I performed
the following SQL query:

UPDATE ImageInformation
SET creationDate = (SELECT Images.modificationDate FROM Images WHERE
ImageInformation.imageid = Images.id)
WHERE digitizationDate is null

The "WHERE digitizationDate is null" is used to adjust the creation date
only of those files without metadata.

For me this query worked fine. But of course someone should only try
this if he/she knows what this stuff is doing. Adapting the digikam
database directly could destroy it! So always make a backup before.
-------------------------------------------------------------------

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list