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

feat: screenshot improvements #1689

Merged
merged 2 commits into from
Oct 9, 2020
Merged

feat: screenshot improvements #1689

merged 2 commits into from
Oct 9, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Oct 9, 2020

This ensures the CID is properly passed to copied link, and that filename is preserved when a single screen setup is used (produces single screenshot). Switched to reliable gateway, as share.ipfs.io is not maintained.

We also avoid low level pinning (MFS is enough) and ensure the produced CID is the same as on CLI (avoiding problems described in ipfs/ipfs-webui#676).

This ensures the CID is properly passed to copied link, and that
filename is preserved when a single screen setup is used (produces
single screenshot)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel lidel added this to the v0.13.1 milestone Oct 9, 2020
Copy link
Contributor

@jessicaschilling jessicaschilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this works for me on Mac, including generating two separate files (Screen 1.png and Screen 2.png) for my multi-screen setup.

One nit: the directory names aren't super user-friendly, probably out of scope for this issue but just wanted to note it. (Just including zeros to confirm to YYYY-MM-DD and HH:MM would take care of that. Probably could omit seconds in the time, too.)
image

- month was -1 (because JS lol)
- added padding and removed spaces for better-looking share URL

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Member Author

lidel commented Oct 9, 2020

@jessicaschilling good catch. In IPFS Companion we use /ipfs-companion-imports/%Y-%M-%D_%h%m%s/ and numbers are padded with zeroes. Seconds are kinda needed if someone takes multiple screenshots one after another and for sorting purposes. We should also avoid : in filenames, because those can't be used on Windows (IIRC).

I've ported what we do in Companion as a starting point, let me know if anything should be tweaked:

2020-10-09--18-10-16

@jessicaschilling
Copy link
Contributor

@lidel Thank you! This sounds good.

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