Opened 9 years ago

Closed 10 months ago

#3779 closed enhancement (wontfix)

MRSID driver's IRasterIO does not read from the correct overview

Reported by: ozdemiray Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

For some images, while trying to read the full extent of the image into a buffer whose size is equal to one of the overviews, MRSID driver reads data from the previous overview an subsamples data.

For example the size of N-36-35_2000.sid file is 47637 x 39169 pixels and its 6th overview's resolution is 745 x 613. When we try to read the whole image into a 745 x 613 buffer, IRasterIO method chooses the 5th overview (whose size is 1489 x 1225) and subsamples the data. This is because the zoom magnitude (dfZoomMag) is 63.897226 for the 6th overview and the for loop in 810th line in mrsiddataset.cpp file (in v1.7.2) adds 0.1 to dfZoomMag before deciding which overview to read.

Change History (2)

comment:1 Changed 5 years ago by Jukka Rahkonen

Is there then an error in the logic that is used in trunk/gdal/frmts/mrsid/mrsiddataset.cpp?

/* -------------------------------------------------------------------- */
869	/*      We need to figure out the best zoom level to use for this       */
870	/*      request.  We apply a small fudge factor to make sure that       */
871	/*      request just very, very slightly larger than a zoom level do    */
872	/*      not force us to the next level.                                 */
873	/* -------------------------------------------------------------------- */
874	    int iOverview = 0;
875	    double dfZoomMag = MIN((nXSize / (double)nBufXSize), 
876	                           (nYSize / (double)nBufYSize));
877	
878	    for( nZoomMag = 1; 
879	         nZoomMag * 2 < (dfZoomMag + 0.1) 
880	             && iOverview < poParentDS->nOverviewCount; 
881	         nZoomMag *= 2, iOverview++ ) {}

comment:2 Changed 10 months ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.