MCPcopy Create free account
hub / github.com/ImpulseAdventure/JPEGsnoop / DecodeMakerSubType

Method DecodeMakerSubType

JfifDecode.cpp:1324–1434  ·  view source on GitHub ↗

Interpret the MakerNote header to determine any applicable MakerNote subtype. PRE: - m_strImgExifMake - buffer INPUT: - none RETURN: - Decode success POST: - m_nImgExifMakeSubtype

Source from the content-addressed store, hash-verified

1322// - m_nImgExifMakeSubtype
1323//
1324bool CjfifDecode::DecodeMakerSubType()
1325{
1326 CString strTmp;
1327
1328 m_nImgExifMakeSubtype = 0;
1329
1330 if (m_strImgExifMake == _T("NIKON"))
1331 {
1332 strTmp = _T("");
1333 for (unsigned nInd=0;nInd<5;nInd++) {
1334 strTmp += Buf(m_nPos+nInd);
1335 }
1336
1337 if (strTmp == _T("Nikon")) {
1338 if (Buf(m_nPos+6) == 1) {
1339 // Type 1
1340 m_pLog->AddLine(_T(" Nikon Makernote Type 1 detected"));
1341 m_nImgExifMakeSubtype = 1;
1342 m_nPos += 8;
1343 } else if (Buf(m_nPos+6) == 2) {
1344 // Type 3
1345 m_pLog->AddLine(_T(" Nikon Makernote Type 3 detected"));
1346 m_nImgExifMakeSubtype = 3;
1347 m_nPos += 18;
1348 } else {
1349 strTmp = _T("ERROR: Unknown Nikon Makernote Type");
1350 m_pLog->AddLineErr(strTmp);
1351 if (m_pAppConfig->bInteractive)
1352 AfxMessageBox(strTmp);
1353 return FALSE;
1354 }
1355 } else {
1356 // Type 2
1357 m_pLog->AddLine(_T(" Nikon Makernote Type 2 detected"));
1358 //m_nImgExifMakeSubtype = 2;
1359 // tests on D1 seem to indicate that it uses Type 1 headers
1360 m_nImgExifMakeSubtype = 1;
1361 m_nPos += 0;
1362 }
1363
1364 }
1365 else if (m_strImgExifMake == _T("SIGMA"))
1366 {
1367 strTmp = _T("");
1368 for (unsigned ind=0;ind<8;ind++) {
1369 if (Buf(m_nPos+ind) != 0)
1370 strTmp += Buf(m_nPos+ind);
1371 }
1372 if ( (strTmp == _T("SIGMA")) ||
1373 (strTmp == _T("FOVEON")) )
1374 {
1375 // Valid marker
1376 // Now skip over the 8-chars and 2 unknown chars
1377 m_nPos += 10;
1378 } else {
1379 strTmp = _T("ERROR: Unknown SIGMA Makernote identifier");
1380 m_pLog->AddLineErr(strTmp);
1381 if (m_pAppConfig->bInteractive)

Callers

nothing calls this directly

Calls 2

AddLineMethod · 0.80
AddLineErrMethod · 0.80

Tested by

no test coverage detected