Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/3331
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 2, 2021
1 parent ce7b0f2 commit f8e8535
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MagickCore/distort.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,11 +1965,11 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method,
fix_bounds = MagickFalse;
geometry.x = geometry.y = 0;
geometry.height = (size_t) ceil(coeff[0]-coeff[1]);
geometry.width = (size_t)
ceil((coeff[0]-coeff[1])*(coeff[5]-coeff[4])*0.5);
geometry.width = (size_t) ceil((coeff[0]-coeff[1])*
(coeff[5]-coeff[4])*0.5);
/* correct scaling factors relative to new size */
coeff[6]=(coeff[5]-coeff[4])/geometry.width; /* changed width */
coeff[7]=(coeff[0]-coeff[1])/geometry.height; /* should be about 1.0 */
coeff[6]=(coeff[5]-coeff[4])*PerceptibleReciprocal(geometry.width); /* changed width */
coeff[7]=(coeff[0]-coeff[1])*PerceptibleReciprocal(geometry.height); /* should be about 1.0 */
break;
}
case Cylinder2PlaneDistortion:
Expand Down

0 comments on commit f8e8535

Please sign in to comment.