Generate screenshots for links
Implement a method or web service to generate screenshots for links to display the content of a site as a small preview.
Update as of Apr. 2021: A "light" version of this feature was implemented by @jeop10. LinkAce saves a thumbnail URL to the database if the websites provides a og:image or twitter:image. I will keep this issue open for a possible full implementation in the future. Support for thumbnails were released in v1.6.0.
Could be interesting: https://github.com/KnpLabs/snappy
Hello first of all, I just discovered LinkAce and I think It's amazing.
Regarding this issue, do you think it will be good (as a first step) just to gather the image that comes from the metatags twitter:image or og:image?
I have been debating on create such modification in my local copy just to see how it works.
Let me know if this is something acceptable for a PR.
Best regards
That is a great idea! We get all HTML meta while adding the link anyway, so LinkAce can save the og:image or twitter:image url to the database. The url can be used to display the picture in the application. Woul be happy to accept a PR for that.
What do you think of this, I am not sure at all about the size of the thumbnail I tried copying the size of others projects but I don't know if you think its too big.
List:

Detail:

Another idea that I have is just to have a setting that allow the user to select on which side they want the image (left or right)
Best regards.
Awesome! I would leave it like that for now, looks fine for me. Advanced settings might be added later on.
Quick update on this:
I completely forgot to check how this look on tablet and mobile width, and there is some adjustment that I need to make to make it work. I cant guarantee that I would have done by today, but I will try to make the pull request tomorrow.
Best Regards.
Have you checked out https://www.thum.io/? You get 1000 screenshot hits per month for free and you could provide a way for users to add their own api key.
Here's an example screenshot: https://image.thum.io/get/maxAge/12/width/2000/https://github.com/Kovah/LinkAce/issues/18
I don't know what the maximum width/height available but it's more than good enough. Full page view is a paid feature though but I don't think it's needed.
Here's the documentation: https://www.thum.io/documentation/api/url.
You could also have a toggle button for showing a preview of the site, albeit somewhat unintuitive.
- It would save some of those free requests
- It would prevent sensitive, personal or whatever you don't want to be sent to thum.io, in regards to privacy
This would mitigate issue #301
I once built a self-hosted tool that provides an API to obtain website screenshots: https://cweiske.de/phancap.htm and https://github.com/cweiske/phancap It's not usable anymore because of PHP major version changes, but maybe it's a start for someone.