-
Notifications
You must be signed in to change notification settings - Fork 195
Image Optimization #947
Comments
I think handling image resizing would be a great value-added service - just like the discovery server currently adds much faster reads of listing and offer state. Another option would be to consider rolling this into the discovery server. When it get's a new listing, it can fetch the images associated with it, resize to some prearranged sizes, place these back on IPFS, and hand out these thumbnail hashes available over IPFS. We don't really want to be at the mercy of a third party for image services. Hosting a service that arbitrarily fetches and processes images can be DDOSed for free, and may be abused for bad non-Origin content. Trusting the client to upload correctly sized thumbnails is certainly far better than what we are doing now, but there's still no guarantee listings will be created with our software or non-maliciously. We could have the discovery server check a listings thumbnails, and not index the listing if the thumbnail sizes are bad..... |
Another option here is |
I'm a bit dismayed by the growing number of centralized services we're now relying on. Since we can get everything we need in the browser without adding another centralized dependency, that would be my vote. The problem w/ using |
Agree we should cut down on centralized services, however Tom's solution is just an optimization... you can still use any IPFS server to get the raw image, we're just optimizing it for file size with the extra URL param |
It's a bit weird to me that we'd be returning content that no longer matches the hash of the file. Feels like that could break things down the line as we/others do integrity checks. |
It is a bit weird, but we can also make it clear from the URL that the hashed content is being modified, e.g. The big downside I can see is that DApp developers would tend to use IPFS nodes that supported this on-the-fly resizing because it'd result in snappier DApps. This would lead to a non uniform distribution of Origin content on IPFS nodes. I think the decentralisation friendly approach is 3. as you noted Josh. It's got its downsides too though: we have to decide on some standard sizes which will be fixed, it results in storing a lot more data, and as Daniel mentioned its a client side solution. Food for thought! |
Good discussion ! Agreed that solution 3. is best from a decentralized standpoint.
|
Yeah, I think we should go with client side resizing to thumbnails, and if needed at some far future date, the discovery server can check that the uploaded images are honest and ding the listing if they aren't. |
Closed in favour of #2187. |
Some listings have very large (> 1Mb) images which are downloaded in full even when we only need to show a thumbnail.
A few possible solutions:
An example optimization using weserv:
Original hat - 1.3Mb
Optimized hat (300px wide) - 31kb
The text was updated successfully, but these errors were encountered: