Skip to content

Commit

Permalink
Merge pull request #5447 from rouault/fix_5445
Browse files Browse the repository at this point in the history
msResampleGDALToMap(): restrict fix done for #1715, to avoid regressions like #5445
  • Loading branch information
rouault committed Jun 14, 2017
2 parents 879ca29 + 3e262f4 commit fdcb24d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mapresample.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,12 @@ int msResampleGDALToMap( mapObj *map, layerObj *layer, imageObj *image,
/* matches the sSrcExtent, even if that generates non-square pixels (#1715) */
/* The rotated case should ideally be dealt with, but not for now... */
if( adfSrcGeoTransform[2] == 0 && adfSrcGeoTransform[4] == 0 &&
adfSrcGeoTransform[5] < 0 )
adfSrcGeoTransform[5] < 0 &&
/* But do that only if the pixels were square before, otherwise */
/* this is going to mess with source rasters whose pixels aren't at */
/* all square (#5445) */
fabs(fabs(adfSrcGeoTransform[1]) - fabs(adfSrcGeoTransform[5])) <
0.01 * fabs(adfSrcGeoTransform[1]) )
{
adfSrcGeoTransform[1] = (sSrcExtent.maxx - sSrcExtent.minx) *
dfNominalCellSize / nLoadImgXSize;
Expand Down

0 comments on commit fdcb24d

Please sign in to comment.