bugfix to correctly pass size of last truncated strip data to TIFFWriteEncodedStrip

This commit is contained in:
Joris Van Damme 2006-03-25 17:52:37 +00:00
parent 993becfa19
commit 64bd1138df
2 changed files with 69 additions and 63 deletions

View File

@ -1,3 +1,8 @@
2006-03-25 Joris Van Damme <joris.at.lebbeke@skynet.be>
* contrib/addtiffo/tif_ovrcache.c: bugfix to correctly pass size
of last truncated strip data to TIFFWriteEncodedStrip
2006-03-25 Joris Van Damme <joris.at.lebbeke@skynet.be>
* libtiff/{tif_jpeg.c, tif_strip.c}: bugfix of tif_jpeg decode raw

View File

@ -1,5 +1,5 @@
/******************************************************************************
* $Id: tif_ovrcache.c,v 1.6 2005-12-21 12:23:13 joris Exp $
* $Id: tif_ovrcache.c,v 1.7 2006-03-25 17:52:37 joris Exp $
*
* Project: TIFF Overview Builder
* Purpose: Library functions to maintain two rows of tiles or two strips
@ -137,6 +137,7 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
int nRet, iTileX, iTileY = psCache->nBlockOffset;
unsigned char *pabyData;
uint32 nBaseDirOffset;
uint32 RowsInStrip;
/* -------------------------------------------------------------------- */
/* If the output cache is multi-byte per sample, and the file */
@ -183,8 +184,7 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
if( psCache->bTiled )
{
nTileID =
TIFFComputeTile( psCache->hTIFF,
nTileID = TIFFComputeTile( psCache->hTIFF,
iTileX * psCache->nBlockXSize,
iTileY * psCache->nBlockYSize,
0, (tsample_t) iSample );
@ -194,14 +194,15 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
}
else
{
nTileID =
TIFFComputeStrip( psCache->hTIFF,
nTileID = TIFFComputeStrip( psCache->hTIFF,
iTileY * psCache->nBlockYSize,
(tsample_t) iSample );
RowsInStrip=psCache->nBlockYSize;
if ((iTileY+1)*psCache->nBlockYSize>psCache->nYSize)
RowsInStrip=psCache->nYSize-iTileY*psCache->nBlockYSize;
TIFFWriteEncodedStrip( psCache->hTIFF, nTileID,
pabyData,
TIFFStripSize(psCache->hTIFF) );
TIFFVStripSize(psCache->hTIFF,RowsInStrip) );
}
}
@ -212,8 +213,7 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
if( psCache->bTiled )
{
nTileID =
TIFFComputeTile( psCache->hTIFF,
nTileID = TIFFComputeTile( psCache->hTIFF,
iTileX * psCache->nBlockXSize,
iTileY * psCache->nBlockYSize,
0, 0 );
@ -223,14 +223,15 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
}
else
{
nTileID =
TIFFComputeStrip( psCache->hTIFF,
nTileID = TIFFComputeStrip( psCache->hTIFF,
iTileY * psCache->nBlockYSize,
0 );
RowsInStrip=psCache->nBlockYSize;
if ((iTileY+1)*psCache->nBlockYSize>psCache->nYSize)
RowsInStrip=psCache->nYSize-iTileY*psCache->nBlockYSize;
TIFFWriteEncodedStrip( psCache->hTIFF, nTileID,
pabyData,
TIFFStripSize(psCache->hTIFF) );
TIFFVStripSize(psCache->hTIFF,RowsInStrip) );
}
}
}