gatsby-transformer-blurhash
gatsby-transformer-blurhash copied to clipboard
[WIP] Expose blurhash string
Hi!
This PR adds a new property to the object returned by blurhash resolver, called hash
that exposes ”blurhash” encoded preview image.
I had changed the file-system caching file extension to .json
, to accommodate the change to having two fields.
Also, does it make sense to actually cache also in a file? Is Gatsby’s caching not enough? Just curious to understand why you have this double-gated system there.
After code is reviewed I will update README to add hash
option and remove [WIP] tag.
In README, I’d also suggest using much smaller size for the example query (say width: 32
) as recommended by blurhash docs – this will decrease the size of currently generated base64 string and make decoding very fast on the client.
I will also add a reference to https://github.com/woltapp/react-blurhash
Fixes #2
Great work there! Thanks for catching the readFileSync
issue :+1:
Let me know when you feel like I can merge your work
Let me know if I can help out with anything to get this PR landed :)
@cobraz if you’d like to update the README with how to use this in a sensible manner then I think it will be good for merging. I’m not so interested in gatsby anymore to spend time on it.