react-worker-image icon indicating copy to clipboard operation
react-worker-image copied to clipboard

Lazy Loading support of an Image

Open vihangpatel opened this issue 7 years ago • 6 comments

Fallback image if image loading fails.

vihangpatel avatar Feb 09 '18 07:02 vihangpatel

What do you mean by if image loading fails.

  1. Incorrect url or
  2. The resource fetch fails..

In case of 1, if it fails due to incorrect url then a lazy load will also not be solving any problem. In case of 2, where image resource fails, i think we can add a catch block in the web worker script, and then use post message api.

nitish24p avatar Feb 09 '18 07:02 nitish24p

Fallback image was another enhancement suggested.

In either case, fallback image should be displayed. For an e.g. Fetching movie poster, if URL incorrect/resource fetch failed, there should be default fallback image which kind of depicts the poster is for movie category.

vihangpatel avatar Feb 09 '18 09:02 vihangpatel

How will this be diff from placeholder

nitish24p avatar Feb 09 '18 11:02 nitish24p

@nitish24p I suppose what is trying to tell is placeholder is image tag right? this will a fallback image incase we do not find that image src.

Meaning a default one

manjula-dube avatar Feb 09 '18 12:02 manjula-dube

Ahh okay.. got it.. cool makes sense.. :) So this is also something which can be taken as a prop.. so its customisable

nitish24p avatar Feb 09 '18 14:02 nitish24p

@vihangpatel you can make a PR for this if you want.. 👍

nitish24p avatar Feb 09 '18 14:02 nitish24p