Opened 14 years ago

Last modified 13 years ago

#626 closed defect (fixed)

MRSid does not use overviews.

Reported by: pracette@… Owned by: dron
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

If you load multiple dataset in a virtual dataset using overview (Zoom level)
image of MrSid and that you write this image to disk you will discover that 
using overview does not resize the source image. I think the problem lies in 
MrSIDRasterBand::IRasterIO where poGDS->poMrSidNav->loadImage( *poImageBuf ); 
does not load the zoom image but the complete image.

Change History (5)

comment:1 Changed 14 years ago by warmerdam

Andrey,

Any thoughts on this?

Patrick,  

I think you may need to provide a more specific example of what is happening.


comment:2 Changed 14 years ago by pracette@…

In MrSIDRasterBand::IRasterIO poGDS->poMrSidNav->fitWithin( imageSupport, 
targetDims ) use image coordinates not overview coordinates...So you must 
adjust the input coordinates to the image coordinates.

I dont know if the rest of the lib use overview coordinates or image 
coordinates but tiff appears to use overview coordinates but I did not have 
the chance to test with other data type.

I added the folowing code to MrSIDRasterBand::IRasterIO just before 
ImageSupport and TargetDims creation.

if( poGDS->bIsOverview ) {
       // Adjust coordinates to current zoom level...
       int iImageXSize = poGDS->poMrSidNav->getImageWidth();
       int iImageYSize = poGDS->poMrSidNav->getImageHeight();
       int iOverviewXSize = GetXSize();
       int iOverviewYSize = GetYSize();

       // Calculate ratio
       float fXRatio = static_cast<float>(iImageXSize) / iOverviewXSize;
       float fYRatio = static_cast<float>(iImageYSize) / iOverviewYSize;
       nXOff *= fXRatio;
       nYOff *= fYRatio;
       nXSize *= fXRatio;
       nYSize *= fYRatio;
    }
This is in no way optimized and shoud probably be put in the constructor.
Modifications may also need to be applied in MrSIDRasterBand::IReadBlock but I 
am not sure about this.

comment:3 Changed 14 years ago by warmerdam

Andrey,

I think you will need to take this one on. 

comment:4 Changed 14 years ago by warmerdam

Andrey,

Is this fixed?  I saw some seemingly related commits some time ago.   If it
is fixed, can we close it? 

comment:5 Changed 13 years ago by warmerdam

I believe MrSID overviews are working smoothly now.  I am closing, but please
re-open if you can still produce problems with GDAL-CVS.

Note: See TracTickets for help on using tickets.