Bug 169637

Summary: EXIF Data Editing Error
Product: [Applications] digikam Reporter: patmartini <vendor>
Component: Plugin-Generic-MetadataEditAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 0.2.0
Attachments: Three changes to fix the rounding issue for aperture values in the metadata
Three changes to fix the rounding issue for aperture values in the metadata

Description patmartini 2008-08-23 05:13:56 UTC
Version:           0.9.4 (using 3.5.9 "release 49.1" , openSUSE 11.0)
Compiler:          Target: x86_64-suse-linux
OS:                Linux (x86_64) release 2.6.25.11-0.1-default

Selection of f5.6 in EXIF edit data saves as f5.5 in image file. I have not tried other f stop numbers. This is a minor issue.
Comment 1 Stefan 2008-11-24 16:18:16 UTC
Created attachment 28796 [details]
Three changes to fix the rounding issue for aperture values in the metadata

- replace the trunc function with the round function
- in the simple reduction loop, the denominator must be 0
- the brute force loop will only be started if the simple reduction fails
- tested for all aperture values
Comment 2 caulier.gilles 2008-11-24 20:00:11 UTC
Which are you patched exactly ?

Can you provide a diff using subversion like it explained here:

http://www.digikam.org/contrib

Thanks in advance

Gilles Caulier
Comment 3 Stefan 2008-11-26 10:34:50 UTC
Created attachment 28833 [details]
Three changes to fix the rounding issue for aperture values in the metadata

Three changes to fix the rounding issue for aperture values in the metadata

I have tested it for all aperture values, but not for other calls.
Comment 4 caulier.gilles 2008-11-26 10:40:03 UTC
Thanks Stephan for your patch.

Marcel,

Patch sound fine for me. Do you see another place where a similar fix must be done ?

Gilles
Comment 5 Marcel Wiesweg 2008-11-26 19:07:22 UTC
SVN commit 889398 by mwiesweg:

Fix from Stefan Beyer:
Change trunc to round.
Fixes the problem that e.g. (5.6 - trunc(5.6)) * 10.0^1 , or 0.6*10.0, can be something like 5.999999999999996447286321.

CCBUG: 169637


 M  +1 -1      kexiv2gps.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=889398
Comment 6 Marcel Wiesweg 2008-11-26 19:11:52 UTC
I have committed the trunc->round fix (see commit message for details).
I dont quite understand the other changes. A denominator may be anything but zero.
Comment 7 caulier.gilles 2008-11-27 07:36:59 UTC
Agree. I think your fix is enough (tested here)

I close this file now.

Gilles
Comment 8 caulier.gilles 2008-11-27 07:42:08 UTC
SVN commit 889546 by cgilles:

sync with trunk
CCBUG: 169637


 M  +3 -3      kexiv2.cpp  


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