more J2c tests for windows
This commit is contained in:
@@ -478,7 +478,7 @@ BOOL LLImageJ2C::validate(U8 *data, U32 file_size)
|
|||||||
if ( res )
|
if ( res )
|
||||||
{
|
{
|
||||||
// Check to make sure that this instance has been initialized with data
|
// Check to make sure that this instance has been initialized with data
|
||||||
if (!getData() || (0 == getDataSize()))
|
if (!getData() || (getDataSize() < 16))
|
||||||
{
|
{
|
||||||
setLastError("LLImageJ2C uninitialized");
|
setLastError("LLImageJ2C uninitialized");
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
|||||||
@@ -70,14 +70,19 @@ std::vector<U8> LLJ2cParser::GetNextComment()
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*BOOL LLJ2cParser::validIterator()
|
||||||
|
{
|
||||||
|
return (mIter != mData.end());
|
||||||
|
}*/
|
||||||
|
|
||||||
//static
|
//static
|
||||||
std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
|
std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
|
||||||
{
|
{
|
||||||
LLJ2cParser* parser = new LLJ2cParser(data,data_size);
|
LLJ2cParser parser = LLJ2cParser(data,data_size);
|
||||||
while(1)
|
//while(1) // I dont think we need to loop
|
||||||
{
|
{
|
||||||
std::vector<U8> comment = parser->GetNextComment();
|
std::vector<U8> comment = parser.GetNextComment();
|
||||||
if (comment.empty()) break; //exit loop
|
if (comment.empty()) return ""; //break; //exit loop
|
||||||
if (comment[1] == 0x00 && comment.size() == 130)
|
if (comment[1] == 0x00 && comment.size() == 130)
|
||||||
{
|
{
|
||||||
//llinfos << "FOUND PAYLOAD" << llendl;
|
//llinfos << "FOUND PAYLOAD" << llendl;
|
||||||
@@ -109,21 +114,19 @@ std::string LLImageMetaDataReader::ExtractEncodedComment(U8* data,int data_size)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
break;//exit loop
|
return "";//break; //exit loop
|
||||||
}
|
}
|
||||||
for (i = 4; i < 128; ++i)
|
for (i = 4; i < 128; ++i)
|
||||||
{
|
{
|
||||||
if (payload[i] == 0) break;
|
if (payload[i] == 0) break;
|
||||||
}
|
}
|
||||||
if(i < 4) break;
|
if(i < 4) return "";//break; //exit loop
|
||||||
std::string result(payload.begin()+4,payload.begin()+i);
|
std::string result(payload.begin()+4,payload.begin()+i);
|
||||||
//llinfos << "FOUND COMMENT: " << result << llendl;
|
//llinfos << "FOUND COMMENT: " << result << llendl;
|
||||||
delete parser;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//end of loop
|
//end of loop
|
||||||
delete parser;
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
// </edit>
|
// </edit>
|
||||||
|
|||||||
Reference in New Issue
Block a user