Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaae0bd

Browse files
committed
Revert "When using nearest neighbor interpolation and not actually scaling, just copy the data. (Note we don't do this for other kinds of interpolation, because the filtering on those interpolations could have an effect even when not actually scaling.)"
This reverts commit 1c9f9b5.
1 parent 527fd07 commit aaae0bd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/_image.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,11 @@ Image::resize(const Py::Tuple& args, const Py::Dict& kwargs)
440440

441441
case NEAREST:
442442
{
443-
if (colsIn == numcols && rowsIn == numrows) {
444-
memcpy(bufferOut, bufferIn, colsIn * rowsIn * 4);
445-
} else {
446-
typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
447-
typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
448-
span_gen_type sg(ia, interpolator);
449-
renderer_type ri(rb, sa, sg);
450-
agg::render_scanlines(ras, sl, ri);
451-
}
443+
typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
444+
typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
445+
span_gen_type sg(ia, interpolator);
446+
renderer_type ri(rb, sa, sg);
447+
agg::render_scanlines(ras, sl, ri);
452448
}
453449
break;
454450

0 commit comments

Comments
 (0)