Bug 179031

Summary: exposure times shown for Panasonic RAW pictures do not make sense
Product: [Applications] digikam Reporter: S. Burmeister <sven.burmeister>
Component: Metadata-RawAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahuggel, marcel.wiesweg
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 0.10.0
Sentry Crash Report:
Attachments: screenshot of exposure time

Description S. Burmeister 2008-12-29 10:38:21 UTC
Version:           0.10 beta8 (using Devel)
OS:                Linux
Installed from:    Compiled sources

As you can see in the screenshot digikam displays a negative exposure time.

If you could tell me if there is a way to check that the picture itself does not do something wrong I could test it. I only have one RAW format though, so I cannot say whether this only happens for Panansonic's .rw2 pictures or for all RAW pictures.

Other pictures show an exposure time of 8s or 100s which seems a bit off too.
Comment 1 S. Burmeister 2008-12-29 10:39:02 UTC
Created attachment 29719 [details]
screenshot of exposure time
Comment 2 Marcel Wiesweg 2008-12-29 13:12:06 UTC
Can you send me the picture and one of the others with 8/100s exposure to my private address?
Comment 3 Marcel Wiesweg 2009-01-02 22:04:51 UTC
These pictures are not supported by exiv2. Andreas, do you know anything about .rw2 files?

Gilles, the wrong values come from libraw's rawFileIdentify. Do you know why these values are wrong?
Comment 4 Andreas Huggel 2009-01-03 09:40:01 UTC
No, but it seems they are of the TIFF-like variety with a custom TIFF-header. At least as far as reading the metadata is concerned. Adding basic read-support to Exiv2 won't be a big deal.
Comment 5 caulier.gilles 2009-01-03 09:58:09 UTC
>Gilles, the wrong values come from libraw's rawFileIdentify. Do you know why >these values are wrong? 

Marcel, 

I don't know. I will contact Alex Tutubalin from LibRaw project for details.

Sven,

Can you perform a simple test with dcraw command line program:

dcraw -i -v myrawfile.rw2 

Another try is to use test program 'identify' from libraw generated with libkdcraw. This program emulate "dcraw -i -v". Just run it with your rw2 file

Gilles Caulier
Comment 6 caulier.gilles 2009-01-03 10:25:58 UTC
Marcel,

This is the response from Alex:

------------------------------------------------------------------
Gilles Caulier wrote:

    Alex,

    Can you take a look in this bug report from KDE bugzilla:

    http://bugs.kde.org/show_bug.cgi?id=179031

I've tested my tiny collection of .rw2 files with identify without any problems.

Also, it is not easy to get negative shutter speed (this value is either directly
read from file or calculated as pow(2, some-value) ).

Possible error source is _float_ shutter value: if some code interprets it as double
many strange things may happen.

Anyway, need sample file with this error

-- 
Alex Tutubalin
Web: http://blog.lexa.ru
mailto:lexa@lexa.ru
--------------------------------------------------------------------------
Comment 7 S. Burmeister 2009-01-03 12:17:09 UTC
For the picture that shows 160 s in digikam I get:

dcraw -i -v p1000039.rw2 

Filename: p1000039.rw2
Timestamp: Tue Dec 23 14:36:55 2008
Camera: Panasonic DMC-LX3          
ISO speed: 80                      
Shutter: 1/160.0 sec               
Aperture: f/2.8                    
Focal length: 5.1 mm               
Embedded ICC profile: no
Number of raw images: 1
Thumb size:  1920 x 1440
Full size:   3724 x 2754
Image size:  3724 x 2754
Output size: 3724 x 2754
Raw colors: 3
Filter pattern: RGGBRGGBRGGBRGGB
Daylight multipliers: 1.000000 1.000000 1.000000
Camera multipliers: 482.000000 263.000000 463.000000 0.000000

For the picture with the negative exposure time I get:

dcraw -i -v p1000041.rw2 

Filename: p1000041.rw2
Timestamp: Tue Dec 23 14:38:43 2008
Camera: Panasonic DMC-LX3          
ISO speed: 80                      
Shutter: 1/125.0 sec               
Aperture: f/2.8                    
Focal length: 5.1 mm               
Embedded ICC profile: no
Number of raw images: 1
Thumb size:  1920 x 1440
Full size:   3724 x 2754
Image size:  3724 x 2754
Output size: 3724 x 2754
Raw colors: 3
Filter pattern: RGGBRGGBRGGBRGGB
Daylight multipliers: 1.000000 1.000000 1.000000
Camera multipliers: 535.000000 263.000000 432.000000 0.000000

If you need the output of "identify" as well, let me know.
Comment 8 Andreas Huggel 2009-01-06 17:08:03 UTC
Exiv2 now has basic read-support for Panasonic RW2 format (SVN trunk, Rev. 1722). It is also possible to extract a JPG preview image from the raw file (that works at least with the samples from a DMC-LX3 and DMC-FZ28 that I have here), using exiv2 with the -pp and -ep options. Interestingly the preview contains a lot more metadata than what is readily available in the RAW file.

Andreas
Comment 9 Marcel Wiesweg 2009-01-06 18:49:33 UTC
SVN commit 906707 by mwiesweg:

Interpret shutter value from libraw correctly

CCBUG: 179031

 M  +1 -1      dmetadata.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=906707
Comment 10 Marcel Wiesweg 2009-01-06 18:51:37 UTC
Ok we fixed the original problem interpreting the value from libraw,
and got full exiv2 support now as well.
Comment 11 S. Burmeister 2009-01-06 19:58:56 UTC
Is there some database with the meta-data or do I need to update anything else than digikam? I just compiled and installed Revision: 906728 and still see the number without the 1/ in front of it and the ...41.rw2 picture I send you now shows -21s.
Comment 12 Marcel Wiesweg 2009-01-06 22:01:25 UTC
Yes the value is stored in the database. (If you look at the metadata tab, which is loaded from the file, the value is correct). There is no UI tool to force a rescan currently. Quick fix for you: open your database file with the sqlite3 tool and execute
UPDATE Images SET modificationDate=NULL WHERE name LIKE '%.rw2';
which forces a rescan of *.rw2 pictures at next start.
Comment 13 S. Burmeister 2009-01-06 23:52:41 UTC
You were right, although I got impatient since your query returned that there is no table Images and just deleted the db. I tried .databases and it showed main and temp, but .tables or .tables * showed nothing. Anyway, after creating a new db it the correct exposure times are shown. Thanks for fixing!