From: Udi F. <udi...@us...> - 2009-02-06 07:30:44
|
Update of /cvsroot/ufraw/ufraw In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11560 Modified Files: ufraw_lens_ui.c Log Message: Automatic lens selection with lensfun. Based on patch by Martin Ling. Index: ufraw_lens_ui.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_lens_ui.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ufraw_lens_ui.c 30 Jun 2008 21:59:51 -0000 1.7 +++ ufraw_lens_ui.c 6 Feb 2009 07:30:40 -0000 1.8 @@ -420,7 +420,8 @@ return; } - lf_lens_copy (CFG->lens, lens); + if (CFG->lens!= lens) + lf_lens_copy (CFG->lens, lens); maker = lf_mlstr_get (lens->Maker); model = lf_mlstr_get (lens->Model); @@ -1284,7 +1285,15 @@ fill_distortion_page (data); fill_geometry_page (data); - lens_set (data, CFG->lens); + const lfLens **lenses = NULL; + if (strlen(CFG->lensText) > 0) + lenses = lf_db_find_lenses_hd(CFG->lensdb, + CFG->camera, NULL, CFG->lensText, 0); + if (lenses!=NULL) { + lf_lens_copy(CFG->lens, lenses[0]); + lf_free(lenses); + } + lens_set(data, CFG->lens); } #endif /* HAVE_LENSFUN */ |