From: Dirk Lemstra Date: Mon, 22 Apr 2019 19:04:08 +0000 (+0200) Subject: Revert changes because gravity offsets go towards the center of the image. X-Git-Tag: 7.0.8-42~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb26480fbd8a891838b8dc61cb5df2511d63e7b9;p=imagemagick Revert changes because gravity offsets go towards the center of the image. --- diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c index 9da69686f..13dd0d430 100644 --- a/MagickCore/attribute.c +++ b/MagickCore/attribute.c @@ -308,7 +308,7 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, NorthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) vertex.top,exception); edge.bottom=GetEdgeBackgroundFactor(edge_image,edge_view, - SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,-(ssize_t) + SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) vertex.bottom,exception); continue; } @@ -320,13 +320,13 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, vertex.right++; bounds.width--; edge.right=GetEdgeBackgroundFactor(edge_image,edge_view, - NorthEastGravity,1,bounds.height,-(ssize_t) vertex.right,(ssize_t) + NorthEastGravity,1,bounds.height,(ssize_t) vertex.right,(ssize_t) vertex.top,exception); edge.top=GetEdgeBackgroundFactor(edge_image,edge_view, NorthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) vertex.top,exception); edge.bottom=GetEdgeBackgroundFactor(edge_image,edge_view, - SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,-(ssize_t) + SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) vertex.bottom,exception); continue; } @@ -341,7 +341,7 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, NorthWestGravity,1,bounds.height,(ssize_t) vertex.left,(ssize_t) vertex.top,exception); edge.right=GetEdgeBackgroundFactor(edge_image,edge_view, - NorthEastGravity,1,bounds.height,-(ssize_t) vertex.right,(ssize_t) + NorthEastGravity,1,bounds.height,(ssize_t) vertex.right,(ssize_t) vertex.top,exception); edge.top=GetEdgeBackgroundFactor(edge_image,edge_view, NorthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) @@ -359,10 +359,10 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, NorthWestGravity,1,bounds.height,(ssize_t) vertex.left,(ssize_t) vertex.top,exception); edge.right=GetEdgeBackgroundFactor(edge_image,edge_view, - NorthEastGravity,1,bounds.height,-(ssize_t) vertex.right,(ssize_t) + NorthEastGravity,1,bounds.height,(ssize_t) vertex.right,(ssize_t) vertex.top,exception); edge.bottom=GetEdgeBackgroundFactor(edge_image,edge_view, - SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,-(ssize_t) + SouthWestGravity,bounds.width,1,(ssize_t) vertex.left,(ssize_t) vertex.bottom,exception); continue; } diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index 5d22d572b..d67b1b503 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -541,7 +541,7 @@ MagickExport void GravityAdjustGeometry(const size_t width, case EastGravity: case SouthEastGravity: { - region->x+=(ssize_t) (width-region->width); + region->x=(ssize_t) (width-region->width-region->x); break; } case NorthGravity: @@ -564,7 +564,7 @@ MagickExport void GravityAdjustGeometry(const size_t width, case SouthGravity: case SouthEastGravity: { - region->y+=(ssize_t) (height-region->height); + region->y=(ssize_t) (height-region->height-region->y); break; } case EastGravity: