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

Making board snapshot #343

Merged

Conversation

loloof64
Copy link
Contributor

@loloof64 loloof64 commented Aug 18, 2024

Adding the ability to take a snapshot of the board, in a PNG image.

The user selects the target path.

Available in play mode as well as in analysis mode.

EnCroissantScreenshot

@loloof64
Copy link
Contributor Author

Maybe a drawback is worth mentionning : I've not prepared a placeholder for the translations.

@franciscoBSalgueiro
Copy link
Owner

Besides the linter errors, there's 2 issues:

  • It doesn't work on Windows: "Error: Attempting to parse an unsupported color function "color".
  • It doesn't work with SVG board images. Most of the board images are PNG, but a few of them (such as the default one) are SVG, and they're not rendered by html2canvas.

Replacing html2canvas with the fork html2canvas-pro fixes the first issue, but not the second one.

@franciscoBSalgueiro
Copy link
Owner

franciscoBSalgueiro commented Aug 20, 2024

I've tried replacing html2canvas with dom-to-image and it seems to work on windows and with svgs. I haven't tested on linux yet.

@loloof64
Copy link
Contributor Author

loloof64 commented Aug 20, 2024

Thank you, so I'll make changes locally and test on linux.
Is there a way to pull those changes in my local copy ? I'm using Github Desktop but I can also do it from terminal.

I've found how to pull changes from Github desktop.

@loloof64
Copy link
Contributor Author

It works on Linux.
The only drawback is that the saved image does not keep the circles and arrows. But maybe that's not so necessary.

As for the linter, I may try to fix those errors.

@franciscoBSalgueiro franciscoBSalgueiro merged commit 5d0d4fd into franciscoBSalgueiro:master Aug 21, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants