Quantcast
Channel: Adobe Community: Message List - XMP SDK
Viewing all articles
Browse latest Browse all 801

Re: "XMPFiles::GetXMP - No open file" on random files, on random occasions.

$
0
0

Hi Sunil,

 

that seems to be the solution. Again: Thank you very much! The final code:

 

 

QStringXmpParser::getXmpContent(QStringfilePath)

{
    try{
     XMP_VersionInfocoreVersion;
     SXMPMeta::GetVersionInfo(&coreVersion);
     std::stringxmpContent;
     XMP_OptionBitsopts=kXMPFiles_OpenForRead|kXMPFiles_OpenUsePacketScanning;
          QByteArrayba=filePath.toLocal8Bit();
     constchar*c_str_FileName=ba.data();
          XMP_StringPtrfilenamePtr=c_str_FileName;
          SXMPFilesmyfile;
          if(!myfile.OpenFile(filenamePtr,kXMP_UnknownFile,opts)){
                qDebug()<<"FailedtoopenSXMPFilefor"<<filePath;
        }
          if(!myfile.GetXMP(NULL,&xmpContent)){
                qDebug()<<"NoXMPdatainfile"<<filePath;
        }
   returnQString::fromStdString(xmpContent.c_str());
    }catch(XMP_Error&e){
          qDebug()<<"Exception:"<<e.GetErrMsg();
          return"";
    }
}

 

Cheers,

dersmon


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>