diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 4a0c64ed7..51e19d7f0 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -233,7 +233,7 @@ LCPProfile::LCPProfile(Glib::ustring fname) { XML_SetUserData(parser, (void *)this); - isFisheye=inCamProfiles=firstLIDone=inPerspect=inAlternateLensID=false; + isFisheye=inCamProfiles=firstLIDone=inPerspect=inAlternateLensID=inAlternateLensNames=false; sensorFormatFactor=1; for (int i=0;i0 ? log(aperture) : 0; float focusDistLog=focusDist>0? log(focusDist)+euler : 0; @@ -445,7 +445,7 @@ void LCPProfile::calcParams(int mode, float focalLength, float focusDist, float } //printf("LCP mode=%i, dist: %g found frames: Fno %g-%g; FocLen %g-%g; Dist %g-%g with weight %g\n", mode, focusDist, pLow->aperture, pHigh->aperture, pLow->focLen, pHigh->focLen, pLow->focDist, pHigh->focDist, facLow); - } else printf("Error: LCP file contained no parameters\n"); + } else printf("Error: LCP file contained no %s parameters\n",mode==0 ? "vignette" : mode == 1 ? "distortion" : "CA" ); } void LCPProfile::print() const { @@ -470,7 +470,8 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons if (!strcmp("CameraProfiles",src)) pProf->inCamProfiles=true; if (!strcmp("AlternateLensIDs",src)) pProf->inAlternateLensID=true; - if (!pProf->inCamProfiles || pProf->inAlternateLensID) return; + if (!strcmp("AlternateLensNames",src)) pProf->inAlternateLensNames=true; + if (!pProf->inCamProfiles || pProf->inAlternateLensID || pProf->inAlternateLensNames) return; if (!strcmp("li",src)) { pProf->pCurPersModel=new LCPPersModel(); @@ -498,7 +499,7 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons } else if (!strcmp("ChromaticBlueGreenModel",src)) { pProf->pCurCommon=&pProf->pCurPersModel->chromBG; parseAttr=true; - } else if (!strcmp("VignetteModel",src)) { + } else if (!strcmp("VignetteModel",src)) { pProf->pCurCommon=&pProf->pCurPersModel->vignette; parseAttr=true; } @@ -520,7 +521,7 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, int len) { LCPProfile *pProf=static_cast(pLCPProfile); - if (!pProf->inCamProfiles || pProf->inAlternateLensID || *pProf->inInvalidTag) return; + if (!pProf->inCamProfiles || pProf->inAlternateLensID || pProf->inAlternateLensNames || *pProf->inInvalidTag) return; // Check if it contains non-whitespaces (there are several calls to this for one tag unfortunately) bool onlyWhiteSpace=true; @@ -588,8 +589,8 @@ void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, in pProf->pCurCommon->scaleFac=atof(raw); else if (!strcmp("ResidualMeanError",tag)) pProf->pCurCommon->meanErr=atof(raw); - else if (!strcmp("RadialDistortParam1",tag) || !strcmp("VignetteModelParam1",tag)) - pProf->pCurCommon->param[0]=atof(raw); + else if (!strcmp("RadialDistortParam1",tag) || !strcmp("VignetteModelParam1",tag)) + pProf->pCurCommon->param[0]=atof(raw); else if (!strcmp("RadialDistortParam2",tag) || !strcmp("VignetteModelParam2",tag)) pProf->pCurCommon->param[1]=atof(raw); else if (!strcmp("RadialDistortParam3",tag) || !strcmp("VignetteModelParam3",tag)) @@ -611,8 +612,9 @@ void XMLCALL LCPProfile::XmlEndHandler(void *pLCPProfile, const char *el) { if (strstr(el,":CameraProfiles")) pProf->inCamProfiles=false; if (strstr(el,":AlternateLensIDs")) pProf->inAlternateLensID=false; + if (strstr(el,":AlternateLensNames")) pProf->inAlternateLensNames=false; - if (!pProf->inCamProfiles || pProf->inAlternateLensID) return; + if (!pProf->inCamProfiles || pProf->inAlternateLensID || pProf->inAlternateLensNames) return; if (strstr(el,":PerspectiveModel") || strstr(el,":FisheyeModel")) pProf->inPerspect=false; diff --git a/rtengine/lcp.h b/rtengine/lcp.h index 690ec0bb5..6d3707f74 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -63,7 +63,7 @@ namespace rtengine { class LCPProfile { // Temporary data for parsing - bool inCamProfiles,firstLIDone,inPerspect,inAlternateLensID; + bool inCamProfiles,firstLIDone,inPerspect,inAlternateLensID,inAlternateLensNames; char lastTag[256],inInvalidTag[256]; LCPPersModel* pCurPersModel; LCPModelCommon* pCurCommon;