private bool fetchStripThing(TiffDirEntry dir, int nstrips, ref int[] lpp)
{
checkDirCount(dir, nstrips);
// Allocate space for strip information.
if (lpp == null)
lpp = new int [nstrips];
else
Array.Clear(lpp, 0, lpp.Length);
bool status = false;
if (dir.tdir_type == TiffType.SHORT)
{
// Handle short -> int expansion.
short[] dp = new short[dir.tdir_count];
status = fetchShortArray(dir, dp);
if (status)
{
for (int i = 0; i < nstrips && i < dir.tdir_count; i++)
lpp[i] = dp[i];
}
}
else if (nstrips != dir.tdir_count)
{
// Special case to correct length
int[] dp = new int[dir.tdir_count];
status = fetchLongArray(dir, dp);
if (status)
{
for (int i = 0; i < nstrips && i < dir.tdir_count; i++)
lpp[i] = dp[i];
}
}
else
{
status = fetchLongArray(dir, lpp);
}
return status;
}