Opened 20 years ago
Last modified 19 years ago
#626 closed defect (fixed)
MRSid does not use overviews.
Reported by: | 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:2 by , 20 years ago
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:4 by , 19 years ago
Andrey, Is this fixed? I saw some seemingly related commits some time ago. If it is fixed, can we close it?
comment:5 by , 19 years ago
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.