<div>hi,</div>
<div> </div>
<div>    Recently I  am writing  a driver(such as driver_a) for GDAL, and the driver need overview function. there are a question about band::IReadBlock(int nBlockXOff, int BlockYOff, void *pImage), you know  the memory of pImage is malloced in the gdal core code such  as  new datablock function, gdal has buildin cache management, and Its size is corresponding overview band size, for example, origin image is 512*512, block size is 256,256, I need to get the 3rd layer of pyramid, in fact, the overview level 3 of the image is 128*128, so the memory of pImage is128*128*byte, but the standard block of my program is 256*256, in  the function of band::IReadBlock(), I need to adjust the size of pixel data, such as</div>

<div> </div>
<div>if ( blockcol&lt;nColumnBlockSize || blockrow&lt;nRowBlockSize )</div>
<div>{</div>
<div>....</div>
<div>}</div>
<div> </div>
<div>memcpy( pImage , pabyBlockBuf, nGDALBlockBytes );</div>
<div> </div>
<div>and copy the pabyBlockBuf into PImage, but now the PImage is 128*128, and pabyBlockBuf is 256*256, so there are some mistakes. and suggestion?</div>
<div> </div>
<div>gispowerfan</div>
<div> </div>
<div> </div>