<p class="MsoNormal"><span style="" lang="EN-GB">Hello,</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">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.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">The
gdalinfo.exe is working effeciently, by using an OGRSpatialReference object. However
i found a problem with the gdal_translate.exe application.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">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).</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">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).</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">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.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">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.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">I think
that it's related to the default size of the destination file image.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">I used
CPLMalloc, CPLRealloc, memset and memcpy functions but it was fruitless. Could
you tell me how to modify this default size?</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">Otherwise
have you any other suggestions.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">With all my
regards.</span></p>
<p class="MsoNormal"><span style="" lang="EN-GB">Cherif
OUESLATI</span></p>