duguyihou / react-native-turbo-image

Performant image component for React Native
https://www.npmjs.com/package/react-native-turbo-image
MIT License
167 stars 9 forks source link

is it possible to Override global imageLoader? #272

Closed vokhuyetOz closed 1 month ago

vokhuyetOz commented 4 months ago

Is your feature request related to a problem? Please describe. it would be useful if we can register all components (decoders) at initialize instead of add it manually when load ImageURl. use this one we can remove format property.

Describe the solution you'd like have no idea now?

duguyihou commented 4 months ago

To be honest, I don't know the performance if we register all decoders. From my understanding, the aim of Nuke or Coil is to handle image loading and caching. Supporting special formats is a bonus. Even though Coil officially provides extensions for Gif and SVG, we still need to add it manually. For Nuke, it does not provide decoders officially. Besides, not all the apps need special format images. Let me know your thoughts 😄

vokhuyetOz commented 4 months ago

i checked on coil/image_pipeline/, it said Custom components must be added to the ImageLoader when constructing it through its ComponentRegistry. So i think it will not cause performance problems. of course we don't need to add all decoders to imageLoader by default, but if we can ask library to add some specials decoder as we want in initialize, it would be great. Sometimes, we don't know if our image is Gif or normal type.

duguyihou commented 4 months ago

yeah, I agree. It may be silly to set format manually. It is not elegant.

duguyihou commented 3 months ago

@vokhuyetOz

maybe we can use newBuilder in Android side to override imageLoader.

image
vokhuyetOz commented 3 months ago

Ok, I see I'll check it out at the weekend

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.