ImageResolver
ImageResolver copied to clipboard
Return an array of images
Could you return an array of multiple primary image possibilities, so that end-users could choose which one is optimal, similar to Facebook post submission?
Great module by the way!
Yes, I was planning to do that some day. Not sure when I will have time to do this, but I'll add it to the roadmap.
Oh cool. Well if you point me in the right direction maybe I can take a look myself and make a pull request.
Here's a quick guide:
- In ImageResolver.resolve, change the callback to accept a string or an array in parameter https://github.com/mauricesvay/ImageResolver/blob/master/src/ImageResolver.js#L53-L64
- If image is an array, return
url
, first item inimage
and add animages
with all or rest of the result array. - Upgrade plugins to return an array when applicable.
- Check and write tests to make sure there are no regressions.
Let me know if you need more info :)