Bug 140030 - date annotations on images are garbled
Summary: date annotations on images are garbled
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Annotation Dialog (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-13 20:51 UTC by Achim Herwig
Modified: 2008-03-26 02:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Herwig 2007-01-13 20:51:42 UTC
Version:           3.0 (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs
OS:                Linux

If one enters a new date in the Annotations Dialog, the date (I selected 2006-12-29) is accepted at first, but not saved with the image. A second annotation shows the date to be set to a range (2006-01-01 to 2006-12-31 in my case).
Comment 1 Shawn Willden 2007-05-10 17:58:24 UTC
I can't reproduce this issue.  If I assign a new date in the annotations dialog, it works as expected, at least on the latest version.  Can you verify this on 3.0.2, or the SVN version?  Or provide more information about how to see the problem?  Thanks.
Comment 2 Baptiste MATHUS 2007-05-10 20:32:09 UTC
I seem to remember something similar to this bug report in the list. If it's the same problem, it was due to the date localization, that's why it's kind of hard to reproduce.

If Achim confirms that the problem is still alive with KPA 3.0.x (x>=1 :p) then could Achim provide us with the locale he's using on his linux box?
Comment 3 Achim Herwig 2007-05-10 22:55:17 UTC
I'm using LANG=de_DE.UTF-8 on OpenSuSE 10.2 - right now the current available version of kphtoalbum is kphotoalbum-3.0-10.4. I will install kphotoalbum from SVN in the next days and check again.
Comment 4 Achim Herwig 2007-05-19 20:40:45 UTC
I checked out Rev. 666385 and compiled it with all options enabled, all developer packages present (I even installed the pqxx-devel package). Same for kipi-plugins. As said, openSuSE 10.2 with latest KDE, updates, packman and guru packages.

I can reconfirm the bug, but I can also give more details now. It is indeed an i18n issue. BTW; I wrote that the date is set to a range: that I cannot reproduce. However, when I select Dec. 29, 2006 it is stored as "Jan. 1, 2006".

This happens with the LOCAL as de_DE.UTF-8 and it only happens for dates in December (if I had known that, I had married in November ;-) ). It does not happen for dates in November or in January. It is not dependend on the year, I can reproduce it with old pictures as well.

Now, when I start kphotoalbum with LANG=C, it still shows german menu titles (and so on), but the date generated from this date input field is no longer "29. Dez 2006", but "29. Dec 2006" and everything works correctly.

Interestingly, when I set such a date correctly, using LANG=C, save everything, restart kphotoalbum with my normal locale and open the annotation dialog for the picture without changing anything, then I'm being asked whether I want to discard my changes. If I store the changes, the date is broken again...

After looking through the source, I guess that DB::ImageDate::monthNames() is the culprit, it tries to find localized versions of the three-letter-abbreviations for the months and fails. For some months the german three-letter-abbreviations are the same as in English and there it works, but for others not. 

Wouldn't it be better that such information (I usually enter it through the KDE date selection widget) is transmitted by conversion to and from text. Wouldn't time_t, or QDateTime, or possibly, its KDE counterpart make more sense and be safer?

Side note: whenever I restart kphotoalbum with a LANG setting different from before, it runs the "Bildinformationen werden aus den neuen Dateien geladen" (picture information are being loaded from the new files) if I saved the file before.
Comment 5 Achim Herwig 2007-05-19 20:45:33 UTC
I checked out Rev. 666385 and compiled it with all options enabled, all developer packages present (I even installed the pqxx-devel package). Same for kipi-plugins. As said, on openSuSE 10.2 with latest KDE, updates, packman and guru packages.

I can reconfirm the bug, but I can also give more details now. It is indeed an i18n issue. BTW; I wrote that the date is set to a range: that I cannot reproduce. However, when I select "Dec. 29, 2006" it is stored as "Jan. 1, 2006".

This happens with LANG=de_DE.UTF-8 and it happens for dates in December. It does not happen for dates in November or in January. It is not dependend on the year, I can reproduce it with old pictures as well that were taken in December of earlier years.

Now, when I start kphotoalbum with LANG=C, it still shows german menu titles (and so on), but the date generated from this date input field is no longer "29. Dez 2006", but "29. Dec 2006" and everything works correctly.

Interestingly, when I set such a date correctly, using LANG=C, save everything, restart kphotoalbum with my german locale and open the annotation dialog for the picture without changing anything, then I'm being asked whether I want to discard my changes. If I store the changes, the date is broken again...

After looking through the source, I guess that date conversion in DB::ImageDate is the culprit, namely the monthNames() function. For some months the german three-letter-abbreviations are the same as in English and there it works, but for others not.

Side note: whenever I restart kphotoalbum with a LANG setting different from before, it runs the "Bildinformationen werden aus den neuen Dateien geladen" (picture information are being loaded from the new files) if I saved the file before.
Comment 6 Aleksej 2008-02-11 18:37:35 UTC
KPA 3.1.0 using KDE 3.5.8 on Debian lenny testing.

Like the above comment says, with LC_TIME=eo.UTF-8, and KPA in English, the months with differing abbreviations fail.

With LC_TIME=ru_RU.UTF-8 and KPA in English or German, (the only checked month) January fails.

It is difficult to check with other app languages, since en_US ←→ fr_FR seems to work correctly both ways; de_DE and en_US work correctly at least with December (which seems to be Dec in both); and other app languages I tried are suffering from bug 145544.
Comment 7 Jan Kundrát 2008-03-26 02:05:47 UTC
SVN commit 790178 by jkt:

Support localized month names in the KDateEdit properly

BUG: 140030


 M  +4 -0      ChangeLog  
 M  +10 -7     DB/ImageDate.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=790178