-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resize
method doesn't work properly
#452
Labels
bug
Something isn't working
Comments
Current result: diff --git a/src/geometry/__tests__/resize.test.ts b/src/geometry/__tests__/resize.test.ts
index df8c0e21..d95281d8 100644
--- a/src/geometry/__tests__/resize.test.ts
+++ b/src/geometry/__tests__/resize.test.ts
@@ -1,6 +1,6 @@
-import { encodePng } from '../../save';
+import { encodePng, writeSync } from '../../save';
-test.skip('compare result of resize with opencv (nearest)', () => {
+test('compare result of resize with opencv (nearest)', () => {
const img = testUtils.load('opencv/test.png');
const resized = img.resize({
@@ -9,6 +9,8 @@ test.skip('compare result of resize with opencv (nearest)', () => {
interpolationType: 'nearest',
});
+ writeSync('test.png', resized);
+
expect(resized).toMatchImage('opencv/testResizeNearest.png');
});
|
tpoisseau
added a commit
that referenced
this issue
Apr 26, 2024
Merged
targos
pushed a commit
that referenced
this issue
May 3, 2024
For further improvements, we should probably look at: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It somehow "zooms" in the image. This is especially visible on the nearest-neighbor version of the test.
There's probably a bug in how we iterate on the pixels.
Implementation: https://github.com/image-js/image-js-typescript/blob/main/src/geometry/resize.ts#L55-L86
We need to fix it so these tests can be enabled:
image-js-typescript/src/geometry/__tests__/resize.test.ts
Lines 3 to 21 in 8d81c2b
Reference created by
image-js-typescript/test/img/opencv/generate.py
Lines 15 to 19 in 8d81c2b
The text was updated successfully, but these errors were encountered: