jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.52k stars 294 forks source link

Does Buku support adding images to bookmarks? #724

Open YousufSSyed opened 8 months ago

YousufSSyed commented 8 months ago

I did some searching and it doesn't seem to.

LeXofLeviafan commented 8 months ago

At this moment, only the following fields exist:

Additionally, a metadata flag "Immutable" exists, for the purpose of excluding the bookmark from batch updates.


I've got some ideas on implementing extended bookmark records by adding support for custom fields (including images, at least as remote URLs); but at the moment there's no such thing and it's probably not gonna be a thing for a while.

There is, however, a good chance that I'll be adding support for rendering descriptions as Markdown to the webUI (bukuserver) fairly soon; in which case, it would be possible to include an externally-hosted image.

(Markdown image example) ```md ![optional alt text](https://remote.site/path/to/image.jpg "optional tooltip") ![Markdown](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/175px-Markdown-mark.svg.png "Markdown logo, from Wikipedia") ``` ![optional alt text](https://remote.site/path/to/image.jpg "optional tooltip") ![Markdown logo](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/175px-Markdown-mark.svg.png "Markdown logo, from Wikipedia")
YousufSSyed commented 8 months ago

What do you think about having screenshots of pages with bookmarks that could be viewed in the web UI? I would help with searching.

LeXofLeviafan commented 8 months ago

…Alright, I didn't quite get that.

Do you mean some sort of a feature to generate such a screenshot automatically? (And storing such a screenshot in the DB as binary data, I presume?) And what is this "searching" you are offering your help with? :thinking:

YousufSSyed commented 8 months ago

Yeah, a feature to generate or get a photo of the page and show it in the web ui with the bookmark, and show the images when searching for bookmarks after entering something in the search bar (I haven't used the web ui, I'm just looking at the screenshots here: https://github.com/jarun/buku/tree/master/bukuserver#readme).

LeXofLeviafan commented 8 months ago

There's a concern of size when storing images in a DB file (though using WebP and smaller resolution reduces the image size, this screenshot converted to WebP would take up about 30Kb… multiply that by the number of bookmarks you're expecting to have, and I give no promises on performance when the file is that large :sweat_smile:). Using an external site (e.g. Imgur or ImageChest) for hosting images might be a better choice for such a use :thinking:

That said, there's also the question of how to take such screenshots. I can name 3 possible solutions here:

I'm guessing it would be possible to implement the 1st and 2nd option (take the screenshot with JS if possible, but allow providing a user-made one as well), but the 3rd one doesn't really seem like a way to go.

…Either way, this is unlikely to be supported until/unless I implement extended records.
And I guess I'd need to redesign how the bookmark are rendered in UI first (…though that would probably be necessary regardless).