Hello,
I am implementing a format specific driver to add new format. So i have to read raster bands from a file in addition of the metadata given in the header. The gdalinfo.exe is working effeciently, by using an OGRSpatialReference object. However i found a problem with the gdal_translate.exe application. In fact, and when debugging, an error appears indicating that it's impossible to write in certain memory address, knowing that the input file to read contain 501 pixels (corresponding to nBlockXSize) and 501 lines (corresponding to nBlockYSize). To avoid this problem, i changed the number of iterations in the for loop, which is allowing reading all the raster bands and filling into the pImage, from (nBlockXSize*nBlockYSize) to (nBlockXSize*125). As a consequence i obtain an image that is a part of the whole image to read which is logic, since i'm not putting all the raster bands. So to summarise the problem: (nBlockXSize*125) is the maximum rows that i can put into the destination file image or i have to use all the (nBlockXSize*nBlockYSize) raster bands. I think that it's related to the default size of the destination file image. I used CPLMalloc, CPLRealloc, memset and memcpy functions but it was fruitless. Could you tell me how to modify this default size? Otherwise have you any other suggestions. With all my regards. Cherif OUESLATI
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
