Added support for some non-standard Tokina LCPs
see issue 1464
This commit is contained in:
parent
c1701da96b
commit
d7b593f74f
@ -458,12 +458,16 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons
|
||||
LCPProfile *pProf=static_cast<LCPProfile*>(pLCPProfile);
|
||||
bool parseAttr=false;
|
||||
|
||||
if (*pProf->inInvalidTag) return; // We ignore everything in dirty tag till it's gone
|
||||
|
||||
// clean up tagname
|
||||
const char* src=strrchr(el,':');
|
||||
if (src==NULL) src=const_cast<char*>(el); else src++;
|
||||
|
||||
strcpy(pProf->lastTag,src);
|
||||
|
||||
if (!strcmp("VignetteModelPiecewiseParam",src)) strcpy(pProf->inInvalidTag,src);
|
||||
|
||||
if (!strcmp("CameraProfiles",src)) pProf->inCamProfiles=true;
|
||||
if (!strcmp("AlternateLensIDs",src)) pProf->inAlternateLensID=true;
|
||||
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) {
|
||||
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)
|
||||
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) {
|
||||
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,":AlternateLensIDs")) pProf->inAlternateLensID=false;
|
||||
|
||||
|
@ -63,7 +63,7 @@ namespace rtengine {
|
||||
class LCPProfile {
|
||||
// Temporary data for parsing
|
||||
bool inCamProfiles,firstLIDone,inPerspect,inAlternateLensID;
|
||||
char lastTag[256];
|
||||
char lastTag[256],inInvalidTag[256];
|
||||
LCPPersModel* pCurPersModel;
|
||||
LCPModelCommon* pCurCommon;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user