Clean up some test files.
This commit is contained in:
parent
1adc9272f8
commit
b45385e8c7
51 changed files with 485 additions and 281 deletions
|
@ -56,7 +56,7 @@ bool PngReader::readChunk()
|
|||
std::string chunkType;
|
||||
BinaryStream::getNextString(mFile->GetInHandle(), chunkType, 4);
|
||||
|
||||
std::cout << "Got chunk with type: " << chunkType << " and length: " << length << std::endl;
|
||||
//std::cout << "Got chunk with type: " << chunkType << " and length: " << length << std::endl;
|
||||
bool lastChunk = false;
|
||||
if (chunkType == "IHDR")
|
||||
{
|
||||
|
@ -118,10 +118,10 @@ bool PngReader::readHeaderChunk()
|
|||
uint32_t file_crc = *BinaryStream::getNextDWord(mFile->GetInHandle());
|
||||
auto crc_calc = mHeader.getCrc();
|
||||
|
||||
std::cout << mHeader.toString() << "*************\n";
|
||||
//std::cout << mHeader.toString() << "*************\n";
|
||||
if (file_crc != crc_calc)
|
||||
{
|
||||
std::cout << "Header crc calc does not match file value. File: " << file_crc << " Header: " << crc_calc << std::endl;;
|
||||
//std::cout << "Header crc calc does not match file value. File: " << file_crc << " Header: " << crc_calc << std::endl;;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -152,7 +152,7 @@ bool PngReader::readIDATChunk(unsigned length)
|
|||
|
||||
if (file_crc != crc_calc)
|
||||
{
|
||||
std::cout << "IDAT crc calc does not match file value. File: " << file_crc << " Header: " << crc_calc << std::endl;;
|
||||
//std::cout << "IDAT crc calc does not match file value. File: " << file_crc << " Header: " << crc_calc << std::endl;;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -170,7 +170,7 @@ std::unique_ptr<Image<unsigned char> > PngReader::read()
|
|||
|
||||
if (!checkSignature())
|
||||
{
|
||||
std::cout << "Signature check failed" << std::endl;
|
||||
//std::cout << "Signature check failed" << std::endl;
|
||||
return image;
|
||||
}
|
||||
|
||||
|
@ -199,5 +199,5 @@ std::unique_ptr<Image<unsigned char> > PngReader::read()
|
|||
void PngReader::decodeData()
|
||||
{
|
||||
mEncoder->decode();
|
||||
std::cout << mEncoder->getData() << "***********" << std::endl;
|
||||
//std::cout << mEncoder->getData() << "***********" << std::endl;
|
||||
}
|
||||
|
|
|
@ -91,13 +91,13 @@ void PngWriter::writeHeader()
|
|||
|
||||
auto crc = mPngHeader.getCrc();
|
||||
|
||||
std::cout << mPngHeader.toString() << "*********" << std::endl;
|
||||
//std::cout << mPngHeader.toString() << "*********" << std::endl;
|
||||
mOutStream->write(crc);
|
||||
}
|
||||
|
||||
void PngWriter::writeEndChunk()
|
||||
{
|
||||
std::cout << "Start writing end chunk" << std::endl;
|
||||
//std::cout << "Start writing end chunk" << std::endl;
|
||||
unsigned length{0};
|
||||
mOutStream->write(length);
|
||||
|
||||
|
@ -112,7 +112,7 @@ void PngWriter::writeEndChunk()
|
|||
auto crc = crc_check.getChecksum();
|
||||
mOutStream->write(crc);
|
||||
|
||||
std::cout << "Writing end chunk" << std::endl;
|
||||
//std::cout << "Writing end chunk" << std::endl;
|
||||
}
|
||||
|
||||
void PngWriter::writeDataChunks(const BufferBitStream& buffer)
|
||||
|
@ -130,7 +130,7 @@ void PngWriter::writeDataChunks(const BufferBitStream& buffer)
|
|||
length = num_bytes - num_dat_chunks*num_bytes;
|
||||
}
|
||||
|
||||
std::cout << "Writing idat length " << num_bytes << std::endl;
|
||||
//std::cout << "Writing idat length " << num_bytes << std::endl;
|
||||
mOutStream->write(num_bytes);
|
||||
|
||||
std::vector<unsigned char> char_data = StringUtils::toBytes("IDAT");
|
||||
|
@ -150,9 +150,9 @@ void PngWriter::writeDataChunks(const BufferBitStream& buffer)
|
|||
}
|
||||
|
||||
auto crc = crc_check.getChecksum();
|
||||
std::cout << "Writing idat crc" << crc << std::endl;
|
||||
//std::cout << "Writing idat crc" << crc << std::endl;
|
||||
mOutStream->write(crc);
|
||||
std::cout << "Finished Writing idat crc" << crc << std::endl;
|
||||
//std::cout << "Finished Writing idat crc" << crc << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue