Bug 288513

Summary: Use .thm files as sidecar when files are present (typical case for Canon camera about CR2 and MKV files)
Product: [Applications] digikam Reporter: Thorsten <M8R-gkdi201>
Component: Metadata-SidecarAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahuggel, caulier.gilles, M8R-gkdi201, thomasdn
Priority: NOR    
Version: 4.3.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 7.1.0
Sentry Crash Report:

Description Thorsten 2011-12-09 00:00:52 UTC
Version:           2.3.0
OS:                MS Windows

Running digiKam 2.3.0 (from SourceForge installer) under Win7 64bit in WinXP SP3 compatibility mode.

Older Canon Cameras add the Metadata of their RAW files (.crw) into sidecar files (.thm), which are basically .jpg files. (I believe that the .crw files contain some Metadata too.) It seems like digiKam doesn't recognize or handle them correctly. Metadata like focal length is read incorrectly, GPS Metadata is not recognized at all. When such RAW files are geotagged with digiKam, digiKam seems to remember their position somehow, although Picasa, GeoSetter and EXIFtool are unable to detect any GPS Metadata. When .thm files are copied into a different directory and renamed as .jpg, digiKam reads and handles their metadata correctly.

Reproducible: Always

Steps to Reproduce:
1. Geotag Canon RAW Files (.crw + .thm) from Powershot S30 or G3 with GeoSetter or Picasa.
2. Show on Map
3. Menu - Image - Metadata - Edit All Metadata - Edit Exif - Lens
4. Use Geotagging Plugin to assign a position (different from position assigned in 1,)


Actual Results:  
After 2: Photos don't show up on Map
After 3: Wrong focal length is displayed (50mm)
After 4: DigiKam shows the photo now the newly assigned position, GeoSetter and Picasa still use the old position from Step 1.

Expected Results:  
After 2: Photos should show up (as do .jpg files or ,cr2 RAW-files of newer cameras. You can verify this by renaming the .thm file to .jpg)
After 3: Correct focal length is 21.3mm
After 4: Metadata should be consistent and be recognized by other Programs like Picasa and GeoSetter (which is based on EXIFtool)

Ignoring the presence of Metadata or interpreting it wrongly is likely to lead overwriting correct Metadata or creating to conflicts between different sets of  Metadata for the same picture.
Comment 1 Thorsten 2011-12-09 00:18:57 UTC
Here is a .zip archive with sample RAW file from a Canon Powershot S30, geotagged with GeoSetter, recognized by Picasa, not recognized by digiKam:

http://dl.dropbox.com/u/31121/digiKam/sample.zip
Comment 2 Marcel Wiesweg 2012-03-22 21:47:02 UTC
Any public opinion whether digikam should support such non-standard sidecar files? Alternatively, they could by a script with help from exiv2 be transformed to proper XMP sidecars.
Comment 3 caulier.gilles 2012-03-22 21:50:38 UTC
Another piece in the big puzzle of metadata. I vote for no. But it's just my opinion...

Instead to try to manage all possible sidecar files as we can, i recommend to try manage official XMP sidecar in the best way. It's a standard after all.

About Exiv2, the question is for Andreas.

Gilles Caulier
Comment 4 Andreas Huggel 2012-03-23 00:41:01 UTC
Exiv2 handles this situation exactly the same way as an image with an XMP sidecar, i.e., it doesn't in any way associate the two files. It can deal with the metadata in the thm file (without a need to rename it) and to some extent also the CRW file.

Personally I'd prefer keeping the thm sidecar rather than having it converted to an XMP sidecar as it contains a makernote which will get lost during the conversion.

Maybe we should consider changing Exiv2 to make that association and "do the right thing" in the presence of a sidecar, so that applications don't have to worry about it. I never really considered that so far, it's just an idea.

Andreas
Comment 5 Marcel Wiesweg 2012-05-19 11:17:05 UTC
We probably need another round of extending our sidecar support, to non-standard files as above, and also caring for basename.xmp (as opposed to basename.suffix.xmp) for reading and moving along.
Only with the next round of kipi+kexiv2 API changes.
Comment 6 caulier.gilles 2012-05-19 13:28:47 UTC
Marcel,

But this must be handle by Exiv2 lib in background. Currently, i'm not sure that thm file are managed by Exiv2 as XMP sidecar. 

I'm sure that THM are JPEG container. So it's easy to play with it. Also, libkexiv2 must have some rules too. libkexiv2 3.0.0 can be a good target to implement it.

Andreas, any viewpoint here about THM support ?

Best

Gilles Caulier
Comment 7 caulier.gilles 2012-06-22 08:49:27 UTC
Official digiKam 2.6.0 release is out since few days now :

http://www.digikam.org/drupal/node/656

Please, check if this entry still valid, or update report accordingly.

Thanks in advance.

Gilles Caulier
Comment 8 Thorsten 2012-06-22 09:20:25 UTC
(In reply to comment #7)
> Please, check if this entry still valid, or update report accordingly.

I'll let you know as soon as the Windows version is out on Sourceforge:
http://sourceforge.net/projects/digikam/files/

Thorsten
Comment 9 Thorsten 2012-07-18 15:29:30 UTC
(In reply to comment #7)
>Official digiKam 2.6.0 release is out since few days now :
> Please, check if this entry still valid, or update report accordingly.

Tested with digiKam 2.7.0 (from SourceForge installer) under Win7 64bit in WinXP SP3 compatibility mode:

The problem persists, in exactly the same way as described above. Gilles, so did you change or fix something about the handling of the RAW sidecar files, or why did you ask? I mean just a change in the version number usually doesn't make bugs go away.

Anyway, the sample from the Canon Powershot S30 is still online here:
http://dl.dropbox.com/u/31121/digiKam/sample.zip

If you need more files with different positions or focal lengths or want to try out other old cameras with RAW sidecar files, just let me know. I still have some files from a Canon G3 and a G6 and a Minolta A1.
Comment 10 caulier.gilles 2012-07-18 15:58:29 UTC
The standard RAW+XMP sidecar files handling have been improved and fixed with last release.

About non standard sidecar files, no changes. As Exiv2 can play with THM as with XMP, the lead improvements need to be done in libkexiv2...

Gilles Caulier
Comment 11 caulier.gilles 2014-08-28 12:59:19 UTC
*** Bug 286276 has been marked as a duplicate of this bug. ***
Comment 12 caulier.gilles 2015-05-16 13:17:07 UTC

*** This bug has been marked as a duplicate of bug 193232 ***
Comment 13 caulier.gilles 2020-08-30 16:11:59 UTC
Fixed with #193232