LinkAce icon indicating copy to clipboard operation
LinkAce copied to clipboard

Generate screenshots for links

Open Kovah opened this issue 7 years ago • 8 comments

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.

Kovah avatar Jan 18 '19 07:01 Kovah

Could be interesting: https://github.com/KnpLabs/snappy

Kovah avatar Jan 27 '20 22:01 Kovah

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

jeop10 avatar Apr 15 '21 11:04 jeop10

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.

Kovah avatar Apr 15 '21 11:04 Kovah

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: list

Detail: 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.

jeop10 avatar Apr 15 '21 14:04 jeop10

Awesome! I would leave it like that for now, looks fine for me. Advanced settings might be added later on.

Kovah avatar Apr 15 '21 14:04 Kovah

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.

jeop10 avatar Apr 16 '21 08:04 jeop10

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.

  1. It would save some of those free requests
  2. 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

iwconfig avatar Dec 04 '21 01:12 iwconfig

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.

cweiske avatar Sep 14 '23 15:09 cweiske