fix a bug in rotate_90

This commit is contained in:
2020-07-04 19:32:33 +02:00
parent 085387aba2
commit b39660cc78
3 changed files with 13 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ extern int verbosity;
int fimg_rotate_90(FloatImg *src, FloatImg *dst, int notused)
{
int foo;
int x, y;
int x, y, j, k;
float rgb[3];
#if DEBUG_LEVEL
@@ -56,7 +56,12 @@ if ( (src->type != dst->type) ||
for (y=0; y<src->height; y++) {
for (x=0; x<src->width; x++) {
fimg_get_rgb(src, x, y, rgb);
fimg_put_rgb(dst, y, x, rgb);
j = (dst->height - x) - 1;
k = (dst->width - y) - 1;
#if DEBUG_LEVEL > 1
fprintf(stderr, "%6d %6d\n", k, j);
#endif
fimg_put_rgb(dst, k, x, rgb);
}
}