@@ -755,8 +755,8 @@ static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double
755755 */
756756int getPixelInterpolated (gdImagePtr im , const double x , const double y , const int bgColor )
757757{
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 );
760760 int yii ;
761761 int i ;
762762 double kernel , kernel_cache_y ;
@@ -1702,13 +1702,6 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
17021702 int new_width , new_height ;
17031703 gdRect bbox ;
17041704
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-
17121705 if (bgColor < 0 ) {
17131706 return NULL ;
17141707 }
@@ -1734,15 +1727,10 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
17341727 long m = gd_fxtoi (f_m );
17351728 long n = gd_fxtoi (f_n );
17361729
1737- if (( n <= 0 ) || ( m <= 0 ) || ( m >= src_h ) || ( n >= src_w ) ) {
1730+ if (m < -1 || n < -1 || m >= src_h || n >= src_w ) {
17381731 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 );
17441732 } 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 );
17461734 }
17471735 }
17481736 dst_offset_y ++ ;
0 commit comments