Summary: | Digikam should match lenses on Exif.CanonCs.LensType, not ExifCanonCs.Lens | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Buchan Milne <bgmilne> |
Component: | Plugin-Editor-LensCorrection | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 1.4.0 | ||
Target Milestone: | --- | ||
Platform: | Mandriva RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 1.5.0 | |
Attachments: |
Trivial patch to use LensType tag on Canon
Patch formatted better to retain comment alignment |
Description
Buchan Milne
2010-09-21 13:11:30 UTC
Created attachment 51856 [details]
Trivial patch to use LensType tag on Canon
Created attachment 51857 [details]
Patch formatted better to retain comment alignment
digiKam 1.5.0 has already a similar patch applied. http://lxr.kde.org/source/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp#968 Gilles Caulier I applied the fix in http://websvn.kde.org/branches/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp?r1=1165407&r2=1172473 to 1.4.0, and it did not work as expected. Instead of automatically matching the exact lens, it matched a different lens which had a focal length range that covered the shortest focal length. In the quick test I did, instead of matching EF-S 17-85mm f/4-5.6 IS USM, it matched EF-S 10-22mm f/3.5-4.5 USM. If I instead place the append call with Exif.CanonCs.LensType before Exif.CanonCs.Lens, then it works as expected. I should probably build from svn, but assuming no other major changes were made, I think this is not fixed. I can supply a sample image if that would help test (I assume some other Canon DSLRs, such as 40D, work with the Exif.CanonCs.Lens tag, and we actually would prefer both types to work, not one or the other). yes send me by mail a test image, or give me a web link to download it Gilles Caulier Looks like it is fixed in trunk in r1178204 In 2.0 branch it still detects the wrong lens for "Canon EF-S 18-55mm f/3.5-5.6 IS" as "Canon EF-S 10-22mm f/3.5-4.5 USM". Although the database has only "Canon EF-S 18-55mm f/3.5-5.6" (without the IS), so that may be the problem. I'd propose to do a regular expression match (if it isn't already, not sure). Martin, There is 2 way to fix this problem: the regex is done in liblensfun using GLib2. I suspect that code is not perfect at this place. This can be fixed in lensfun code of course and reported to lensfun project to backport patch. This is done by this stage 1 : http://lxr.kde.org/source/extragear/graphics/digikam/libs/dimg/filters/lens/lensfuniface.cpp#275 Another way is to patch the digiKam lenfun interface to process a regex based on Qt4::QString. Stage 2 is specific to Nikon camera/lens: http://lxr.kde.org/source/extragear/graphics/digikam/libs/dimg/filters/lens/lensfuniface.cpp#280 There is the last stage : http://lxr.kde.org/source/extragear/graphics/digikam/libs/dimg/filters/lens/lensfuniface.cpp#294 I recommend to add a new stage for Canon camera before last stage, if you choose to patch digiKam lensfun interface source code. Please patch trunk, i will backport later GSoC 2010 branch. Gilles Caulier By looking at that, I think that just doing a "reverse search" could be enough. Because now it takes the exiv data and looks into the database. But if this string is just longer by the "IS" or something, it won't match. But if it would be done the other way round - by matching the database to the exiv string, this would work. Consider a use case, when the manufacturer creates just new lenses and adds stuff to the string (like "IS" or something else) but the actual lenses stays the same, this would still get matched with my proposed way. Okay, I'll play with it a little and see what I can come up with. |