Permalink
Browse files

Fix for WMS requests with width and height of 1 (#4629)

  • Loading branch information...
1 parent 5ca2255 commit 3d37bd8531cab096017dca0c8eb2a23b1b33c549 @tbonfort tbonfort committed Apr 11, 2013
Showing with 4 additions and 1 deletion.
  1. +3 −0 maputil.c
  2. +1 −1 mapwms.c
View
@@ -740,6 +740,9 @@ double msAdjustExtent(rectObj *rect, int width, int height)
{
double cellsize, ox, oy;
+ if(width == 1 || height == 1)
+ return 0;
+
cellsize = MS_MAX(MS_CELLSIZE(rect->minx, rect->maxx, width), MS_CELLSIZE(rect->miny, rect->maxy, height));
if(cellsize <= 0) /* avoid division by zero errors */
View
@@ -1664,7 +1664,7 @@ this request. Check wms/ows_enable_request settings.",
** in by half a pixel. We wait till here because we want to ensure we
** are doing this in terms of the correct WIDTH and HEIGHT.
*/
- if( adjust_extent ) {
+ if( adjust_extent && map->width>1 && map->height>1 ) {
double dx, dy;
dx = (map->extent.maxx - map->extent.minx) / map->width;

0 comments on commit 3d37bd8

Please sign in to comment.