Closed mattlewis92 closed 7 years ago
To access the assets via cdn you'll need to include one of the available png sizes (32, 64, 128) in the url like: https://cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f1ee-1f1f8.png.
Sorry I should have been a bit more specific, the JS code assumes a default of 32 pixels and so doesn't add it to the urls it generates: https://github.com/emojione/emojione/blob/master/lib/js/emojione.js#L262
@mattlewis92 thanks for clarifying and pointing this out, I'll adjust the logic here and get a patch out soon.
I just noticed this behavior in the library version 3.1
. It also looks like the emojiSize
option is ignored, as well as defaultPathPNG
, making it unusable (?!) as all the generated point to a broken link..
Looking at the code, I was wondering what's the reason for this:
ePath = (ns.emojiSize !== '32') ? ns.defaultPathPNG + ns.emojiSize + '/' : ns.imagePathPNG
rather than simply:
ePath = ns.defaultPathPNG + ns.emojiSize + '/'
This should be fixed in the 3.1.1 release. @rshk the logic for that should be a little more clear now, the reasoning being that we want the user to be able to define an emoji size to fetch from the CDN path, but if the user is fetching the images locally from a directory with no size indicated, the size parameter could conflict with the local path. Now indicating an image path other than the default CDN path simply overwrites the original image path and the image size parameter.
For example: https://cdn.jsdelivr.net/emojione/assets/3.1/png/1f1ee-1f1f8.png