@@ -755,8 +755,8 @@ static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double
755
755
*/
756
756
int getPixelInterpolated (gdImagePtr im , const double x , const double y , const int bgColor )
757
757
{
758
- const int xi = (int )(( x ) < 0 ? x - 1 : x );
759
- const int yi = (int )(( y ) < 0 ? y - 1 : y );
758
+ const int xi = (int )(x );
759
+ const int yi = (int )(y );
760
760
int yii ;
761
761
int i ;
762
762
double kernel , kernel_cache_y ;
@@ -1702,13 +1702,6 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
1702
1702
int new_width , new_height ;
1703
1703
gdRect bbox ;
1704
1704
1705
- const gdFixed f_slop_y = f_sin ;
1706
- const gdFixed f_slop_x = f_cos ;
1707
- const gdFixed f_slop = f_slop_x > 0 && f_slop_y > 0 ?
1708
- (f_slop_x > f_slop_y ? gd_divfx (f_slop_y , f_slop_x ) : gd_divfx (f_slop_x , f_slop_y ))
1709
- : 0 ;
1710
-
1711
-
1712
1705
if (bgColor < 0 ) {
1713
1706
return NULL ;
1714
1707
}
@@ -1734,15 +1727,10 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
1734
1727
long m = gd_fxtoi (f_m );
1735
1728
long n = gd_fxtoi (f_n );
1736
1729
1737
- if (( n <= 0 ) || ( m <= 0 ) || ( m >= src_h ) || ( n >= src_w ) ) {
1730
+ if (m < -1 || n < -1 || m >= src_h || n >= src_w ) {
1738
1731
dst -> tpixels [dst_offset_y ][dst_offset_x ++ ] = bgColor ;
1739
- } else if ((n <= 1 ) || (m <= 1 ) || (m >= src_h - 1 ) || (n >= src_w - 1 )) {
1740
- register int c = getPixelInterpolated (src , n , m , bgColor );
1741
- c = c | (( gdTrueColorGetAlpha (c ) + ((int )(127 * gd_fxtof (f_slop )))) << 24 );
1742
-
1743
- dst -> tpixels [dst_offset_y ][dst_offset_x ++ ] = _color_blend (bgColor , c );
1744
1732
} else {
1745
- dst -> tpixels [dst_offset_y ][dst_offset_x ++ ] = getPixelInterpolated (src , n , m , bgColor );
1733
+ dst -> tpixels [dst_offset_y ][dst_offset_x ++ ] = getPixelInterpolated (src , gd_fxtod ( f_n ), gd_fxtod ( f_m ) , bgColor );
1746
1734
}
1747
1735
}
1748
1736
dst_offset_y ++ ;
0 commit comments