Skip to content

Commit

Permalink
Generate a deeper stack trace for c-blosc compressions
Browse files Browse the repository at this point in the history
  • Loading branch information
emild authored and emild committed Mar 9, 2024
1 parent d219a80 commit 4204fbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PhotoshopAPI/src/Util/Struct/ImageChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,19 @@ struct ImageChannel : public BaseImageChannel
std::cout << "Iterating chunk: " << nchunk << std::endl;
// Cast to uint8_t* to iterate by bytes, not by T
void* ptr = reinterpret_cast<uint8_t*>(imageData.data()) + nchunk * m_ChunkSize;
std::cout << "Offset from start: " << nchunk * m_ChunkSize;
int64_t nchunks;
if (remainingSize > m_ChunkSize)
{
// C-blos2 returns the total number of chunks here
std::cout << "Preparing to append: " << m_ChunkSize << " bytes to buffer" << std::endl;
nchunks = blosc2_schunk_append_buffer(m_Data, ptr, m_ChunkSize);
remainingSize -= m_ChunkSize;
}
else
{
// C-blos2 returns the total number of chunks here
std::cout << "Preparing to append: " << remainingSize << " bytes to buffer" << std::endl;
nchunks = blosc2_schunk_append_buffer(m_Data, ptr, remainingSize);
remainingSize = 0;
}
Expand Down

0 comments on commit 4204fbd

Please sign in to comment.