ipfs-search / dweb-search-frontend

Frontend for ipfs-search.com
https://dweb-search-frontend.on.fleek.co/
GNU Affero General Public License v3.0
22 stars 16 forks source link

Thumbnails #66

Open DonaldTsang opened 5 years ago

DonaldTsang commented 5 years ago

For Image and Video file searching, there should be thumbnails.

madnificent commented 5 years ago

@dokterbob We should receive the thumbnails from the API. Ideally hosted over IPFS ^_^. Do you move that as a story to the backend?

DonaldTsang commented 5 years ago

@madnificent the front-end design would need to adapt to the back-end feature, so I think keeping this here would be useful.

madnificent commented 5 years ago

@DonaldTsang Somewhat agree but I trust @dokterbob to re-open it on this backlog once the backend has a first version ready. I'm fine with it either way, it should be opened in the backend first and we need to keep track of it.

DonaldTsang commented 5 years ago

Got it

ivan386 commented 5 years ago

@madnificent If file small than it can be self used as thumbnail.

dokterbob commented 5 years ago

@ivan386 Good point! @madnificent What do you think?

DonaldTsang commented 5 years ago

@ivan386 @dokterbob I would say anything smaller than 256px should be used as Thumbnail.

dokterbob commented 5 years ago

Given the backend implementation, it would be easiest to use the filesize. Perhaps we can use a single IPFS block as the criterium, as they will be fetched in one go: 256KB. Browsers are pretty good and efficient at scaling images nowadays.

DonaldTsang commented 5 years ago

Also a pretty smart idea: https://github.com/FLIF-hub/FLIF or https://github.com/cloudinary/fuif for progressively rendered thumbnail, such that it can take only the first N kilobytes of data to have an image resolution of 256px without the need of the other pieces of data.

DonaldTsang commented 5 years ago

https://github.com/ipfs-search/ipfs-search/issues/114

ivan386 commented 5 years ago

@madnificent @dokterbob First block of progressive JPEG can be used as Thumbnail.

Example:

Full image image

First block image

But may be problems in firefox. It show white square in random times.

DonaldTsang commented 5 years ago

@ivan386 a very compatible solution, what about using WebP (VP8/VP9) or HEIF/HEIC/AVCI (x264/x265) or AVIF (AV1)? Does any of those support partial renderings? Or even Adam7 interlaced PNG?

madnificent commented 5 years ago

I think using the original content as a thumbnail should be last resort. If we intend to build a search for thumbnails specifically, with a dedicated UI, then that would indeed be awesome. If we want to download the full content when the search results are being fetched then that would be awesome too (I think that was in one of the earlier v2 frontend releases). If we want to verify whether an image is sufficiently small to be used as an image, then I doubt it will have much success.

If we are generating the thumbnails ourselves, I'd personally prefer a simple and well understood format. We're trying to build thumbnails, not host the original content. If we generate thumbnails and place them in a shared IPFS folder with a name based on the original IPFS hash of the object, then they could easily be used by other projects too. That sounds super rad to me. Not sure if @dokterbob agrees.

Is a thumbnail service something that could be PRd into the current backend core @dokterbob or do you need a good oversight for that to happen correctly?

dokterbob commented 3 years ago

I'd love to run a thumbnail service, but it requires sharded directories for the proposed interface to work. I've been thinking about it and will continue to do so as we figure out more day to day issues.