Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Tools/CmdLine/IccApplyProfiles/TiffImg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,16 @@ bool CTiffImg::Create(const char *szFname, unsigned int nWidth, unsigned int nHe

m_nCurLine = 0;
m_nCurStrip = 0;

// we should always calculate this
m_nBytesPerSample = m_nBitsPerSample / 8;

if (bSep && m_nSamples>1) {
m_nStripSamples = m_nSamples;
if (m_nBitsPerSample % 8) {
Close();
return false;
}
m_nBytesPerSample = m_nBitsPerSample / 8;

m_nStripSize = (unsigned int)TIFFStripSize(m_hTif);
m_nBytesPerStripLine = m_nWidth * m_nBytesPerSample;
Expand Down Expand Up @@ -408,7 +410,7 @@ bool CTiffImg::WriteLine(unsigned char *pBuf)
src += m_nStripSize;
}
}
else if (TIFFWriteEncodedStrip(m_hTif, m_nCurStrip, pBuf, m_nBytesPerLine) < 0)
else if (TIFFWriteEncodedStrip(m_hTif, m_nCurStrip, pBuf, m_nWidth*m_nBytesPerSample) < 0)
return false;

m_nCurStrip++;
Expand Down
3 changes: 2 additions & 1 deletion Tools/CmdLine/IccSpecSepToTiff/iccSpecSepToTiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ int main(int argc, char* argv[]) {

// use unique_ptr to automatically free the buffers
std::unique_ptr<icUInt8Number> inbufffer( new icUInt8Number[ bytePerLine*nSamples ] );
std::unique_ptr<icUInt8Number> outbuffer( new icUInt8Number[ f->GetWidth() * bytesPerSample * nSamples ] );
size_t outSize = f->GetWidth() * bytesPerSample * nSamples;
std::unique_ptr<icUInt8Number> outbuffer( new icUInt8Number[ outSize ] );
icUInt8Number *inbuf = inbufffer.get();
icUInt8Number *outbuf = outbuffer.get();

Expand Down