gatsby-transformer-blurhash icon indicating copy to clipboard operation
gatsby-transformer-blurhash copied to clipboard

[WIP] Expose blurhash string

Open gryzzly opened this issue 4 years ago • 3 comments

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

gryzzly avatar May 18 '20 19:05 gryzzly

Great work there! Thanks for catching the readFileSync issue :+1:

Let me know when you feel like I can merge your work

m5r avatar Jun 08 '20 07:06 m5r

Let me know if I can help out with anything to get this PR landed :)

simenandre avatar Apr 15 '21 20:04 simenandre

@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.

gryzzly avatar Apr 24 '21 11:04 gryzzly