brh55 / react-native-masonry

:raised_hands: A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

passing image dimensions internally

vvavepacket opened this issue · comments

Lets say we are fetching 100 images. and then let us say i have the data for those image dimensions (ill be creating an API that exposes the image dimensions, that would be much faster than downloading the image and then examining the dimensions once fully downloaded). is there any way i can pass those image dimensions internally so that this module will load faster? (please correct my understanding that this module will just render all the images provided they have been downloaded and cached only)

That feature currently doesn't exist, fortunately it wouldn't be too hard to implement. The fetching image dimension logic is managed through the model.js file.
So it would just be a matter of checking if the data already contains a dimensions property, and if so return the data as is.