Added support for some non-standard Tokina LCPs
see issue 1464
This commit is contained in:
@@ -458,12 +458,16 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons
|
|||||||
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
||||||
bool parseAttr=false;
|
bool parseAttr=false;
|
||||||
|
|
||||||
|
if (*pProf->inInvalidTag) return; // We ignore everything in dirty tag till it's gone
|
||||||
|
|
||||||
// clean up tagname
|
// clean up tagname
|
||||||
const char* src=strrchr(el,':');
|
const char* src=strrchr(el,':');
|
||||||
if (src==NULL) src=const_cast<char*>(el); else src++;
|
if (src==NULL) src=const_cast<char*>(el); else src++;
|
||||||
|
|
||||||
strcpy(pProf->lastTag,src);
|
strcpy(pProf->lastTag,src);
|
||||||
|
|
||||||
|
if (!strcmp("VignetteModelPiecewiseParam",src)) strcpy(pProf->inInvalidTag,src);
|
||||||
|
|
||||||
if (!strcmp("CameraProfiles",src)) pProf->inCamProfiles=true;
|
if (!strcmp("CameraProfiles",src)) pProf->inCamProfiles=true;
|
||||||
if (!strcmp("AlternateLensIDs",src)) pProf->inAlternateLensID=true;
|
if (!strcmp("AlternateLensIDs",src)) pProf->inAlternateLensID=true;
|
||||||
if (!pProf->inCamProfiles || pProf->inAlternateLensID) return;
|
if (!pProf->inCamProfiles || pProf->inAlternateLensID) return;
|
||||||
@@ -516,7 +520,7 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons
|
|||||||
void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, int len) {
|
void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, int len) {
|
||||||
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
||||||
|
|
||||||
if (!pProf->inCamProfiles || pProf->inAlternateLensID) return;
|
if (!pProf->inCamProfiles || pProf->inAlternateLensID || *pProf->inInvalidTag) return;
|
||||||
|
|
||||||
// Check if it contains non-whitespaces (there are several calls to this for one tag unfortunately)
|
// Check if it contains non-whitespaces (there are several calls to this for one tag unfortunately)
|
||||||
bool onlyWhiteSpace=true;
|
bool onlyWhiteSpace=true;
|
||||||
@@ -599,6 +603,12 @@ void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, in
|
|||||||
void XMLCALL LCPProfile::XmlEndHandler(void *pLCPProfile, const char *el) {
|
void XMLCALL LCPProfile::XmlEndHandler(void *pLCPProfile, const char *el) {
|
||||||
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
||||||
|
|
||||||
|
// We ignore everything in dirty tag till it's gone
|
||||||
|
if (*pProf->inInvalidTag) {
|
||||||
|
if (strstr(el,pProf->inInvalidTag)) *pProf->inInvalidTag=0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strstr(el,":CameraProfiles")) pProf->inCamProfiles=false;
|
if (strstr(el,":CameraProfiles")) pProf->inCamProfiles=false;
|
||||||
if (strstr(el,":AlternateLensIDs")) pProf->inAlternateLensID=false;
|
if (strstr(el,":AlternateLensIDs")) pProf->inAlternateLensID=false;
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ namespace rtengine {
|
|||||||
class LCPProfile {
|
class LCPProfile {
|
||||||
// Temporary data for parsing
|
// Temporary data for parsing
|
||||||
bool inCamProfiles,firstLIDone,inPerspect,inAlternateLensID;
|
bool inCamProfiles,firstLIDone,inPerspect,inAlternateLensID;
|
||||||
char lastTag[256];
|
char lastTag[256],inInvalidTag[256];
|
||||||
LCPPersModel* pCurPersModel;
|
LCPPersModel* pCurPersModel;
|
||||||
LCPModelCommon* pCurCommon;
|
LCPModelCommon* pCurCommon;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user