Opened 12 years ago

Closed 12 years ago

#4172 closed defect (fixed)

Raster layer fails to be drawn if the window is less than half a pixel

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: warmerdam

Description

When we zoom deep in a raster layer and the window is less than half a pixel.. mapserver just returns a blank image. In a OL viewer the change is critical and pass from a valid colored images to a blank one without error.

MapServer should allow those special cases when the window is less than half a pixel but still positive.

Attachments (2)

raster_half_pixel_window.patch (1.4 KB ) - added by aboudreault 12 years ago.
fix
off_window.patch (745 bytes ) - added by aboudreault 12 years ago.

Download all attachments as: .zip

Change History (8)

by aboudreault, 12 years ago

fix

comment:1 by aboudreault, 12 years ago

FrankW, could you confirm that my patch is ok and if if I should backport it to branch-6-0. I've run the msautotest/gdal part and nothing change on this side.

comment:2 by warmerdam, 12 years ago

Alan,

Could you try a slight variation that makes sure no special values fall through the cracks and so the issue is more fully explained? Something like (untested):

   src_xsize = MIN(MAX(0,(int) (urx - llx + 0.5)), GDALGetRasterXSize(hDS) - src_xoff); 

   /* We want very small windows to use at least one source pixel (#4172) */
   if( src_xsize == 0 && (urx - llx) > 0.0 )
       src_xsize = 1;

comment:3 by aboudreault, 12 years ago

Excellent FrankW. I'm going to commit the fix with your variation. I also going to backport this.

comment:4 by aboudreault, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r13027 and backported in branch 6.0 in r13028.

comment:5 by aboudreault, 12 years ago

Resolution: fixed
Status: closedreopened

It has been reported that the fix do not work when the window is off (on the raster source boundaries). I will attach a patch from Frank's hints. Frank, please confirm that the patch is ok.

by aboudreault, 12 years ago

Attachment: off_window.patch added

comment:6 by aboudreault, 12 years ago

Resolution: fixed
Status: reopenedclosed

Fixed and committed in r13206 and backported in 6.0 in r13205

Note: See TracTickets for help on using tickets.