ImageResolver icon indicating copy to clipboard operation
ImageResolver copied to clipboard

Return an array of images

Open davidhlee opened this issue 9 years ago • 3 comments

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!

davidhlee avatar Dec 15 '14 08:12 davidhlee

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.

mauricesvay avatar Dec 15 '14 08:12 mauricesvay

Oh cool. Well if you point me in the right direction maybe I can take a look myself and make a pull request.

davidhlee avatar Dec 15 '14 18:12 davidhlee

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 in image and add an images 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 :)

mauricesvay avatar Dec 15 '14 21:12 mauricesvay