[Gdal-dev] MrSID dataset

Andy Tompkins atompkins at fastmail.fm
Wed Sep 21 08:17:02 EDT 2005


I have just started using GDAL and I have a question about the MrSID
dataset.

I find that I get a black line drawn down the left and bottom sides of
the image after decoding the file with dataset->RasterIO().  I believe
that I have found a fix for this problem.

change MrSIDDataset::IRasterIO(), line 761 from:
    nZoomMag * 2 < (dfZoomMag + 0.1) && iOverview < nOverviewCount;
to
    nZoomMag * 2 < dfZoomMag && iOverview < nOverviewCount;

and change MrSIDDataset::IRasterIO(), lines 772, and 773 from:
    nTmpXSize = (int) floor( nXSize / (double) nZoomMag + 0.99 );
    nTmpYSize = (int) floor( nYSize / (double) nZoomMag + 0.99 );
to
    nTmpXSize = (int) floor( nXSize / (double) nZoomMag );
    nTmpYSize = (int) floor( nYSize / (double) nZoomMag );

This seems to fix the problem.  I guess I am wondering if I have missed
something and/or if there is a better/correct way to fix my problem? 
Also, if
this is a good/correct fix, how does this change get into
GDAL?

Thank you in advance,
  Andy Tompkins



More information about the Gdal-dev mailing list