Skip to content
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

Ошибка аргументов sharp resize в assertView #1006

Open
1 task
hheimerd opened this issue Aug 29, 2024 · 1 comment
Open
1 task

Ошибка аргументов sharp resize в assertView #1006

hheimerd opened this issue Aug 29, 2024 · 1 comment

Comments

@hheimerd
Copy link

Verify latest release

  • I verified that the issue exists in the latest Hermione release

Hermione version

No response

Last Hermione version that worked

No response

Which area(s) of Hermione are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

Шаги воспроизведения не подскажу, но знаю, как пофиксить.

Actual Behavior

Падает ошибка
"Expected integer for top but received 0.5 of type number"
at Object.invalidParameterError (/[email protected]/node_modules/sharp/lib/is.js:135:10)
at Sharp. (/[email protected]/node_modules/sharp/lib/resize.js:475:16)
at Array.forEach ()
at Sharp.extract (/[email protected]/node_modules/sharp/lib/resize.js:470:38)
at Image.crop (/[email protected]/node_modules/hermione/src/image.js:37:19)
at async Viewport.handleImage (/[email protected]/node_modules/hermione/src/browser/screen-shooter/viewport/index.js:47:9)
at async ScreenShooter.capture (/[email protected]/node_modules/hermione/src/browser/screen-shooter/index.js:21:9)
at async assertView (/[email protected]/node_modules/hermione/src/browser/commands/assert-view/index.js:82:29)

Expected Behavior

Ошибки быть не должно

Which Node.js version are you using?

20.10.0

@hheimerd
Copy link
Author

Нужно в функцию _sanitize добавить Math.floor/ceil. Тут еще встает вопрос совместимости таких изменений, можно округлять возле вызова resize, но вроде как метод _sanitize должен делать значения безопасными.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant