id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 4965,Intergraph image scaling is so slow as to be unusable and incorrect offset if first read isn't top scanline,cleo,warmerdam,"I provide three fixes in the attached patches for their respective files in frmts/ingr. I ask if these fixes can be verified and applied to the GDAL codebase. Thank you. 1. Using the arbitrary nearest neighbour downsampler, the INGR driver's IReadBlock function would loop and each iteration would recurse causing all previous scanlines to be repeatedly and recursively loaded making the read time near infinitely long. Included Fix: Loop backwards in scanlines until a valid RLE offset is found and then start updating RLE offsets from there. Also, no more recursion. 2. When updating the cached scanline offset table, it would decompress the entire scanline even if that scanline was not used. Included Fix: The INGR_Decode function may now take a NULL pointer for the destination pointer argument pabyDstData indicating that decompression may be bypassed. Value pointed to by pnBytesConsumed is still updated and this is what we want to update the scanline offset table anyhow. IReadBlock has been updated to pass NULL when updating scanline offsets mentioned in item #1. Could have added a check that if both pabyDstData and pnBytesConsumed are NULL to return immediately, but figured it's unnecessary since it's the caller that is using it incorrectly and doesn't harm anything. 3. When using the arbitrary downsampler (and likely any reads though I haven't tested it), if the first scanline is not read, the image will always have a strange offset applied making the image look cut off or crash. The offset applied happens to be the width of an uncompressed scanline times the scanline index and this gets applied to the RLE buffer which is incorrect and why the offset happened. Included fix: In IReadBlock, when doing LoadBlockBuf for non-tiled images, use block offset (0,0) to load entire RLE data. Since this never gets called again for non-tiled images, this should not break other RLE files. All fixes provided used version 1.9.1. ",defect,closed,normal,1.10.0,GDAL_Raster,1.9.1,major,fixed,ingr rle,