Skip to content

Commit

Permalink
Fix for WMS requests with width and height of 1 (#4629)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Apr 12, 2013
1 parent 5ca2255 commit 3d37bd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions maputil.c
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion mapwms.c
Expand Up @@ -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;
Expand Down

0 comments on commit 3d37bd8

Please sign in to comment.