blurhash
blurhash copied to clipboard
Blurash decode JS draw single line
Hello to all.
First of all, thank you for the work done on these bookstores.
I am currently testing the implementation of this one on a project. The encoding, although long in PHP went well but when it comes to decode it in JS, I get a single line and nothing else.
However, when I look at the state of the variables, they seem to be correct.
here is the portion of code for the decoding in JS :
`
import {decode } from "blurhash"
const pixels = decode("L5FY440001?a00~CJDoJ00S$?HH?",32,32); console.log(pixels); const canvas = document.createElement('canvas'); canvas.width = document.body.clientWidth; canvas.height = 405; const ctx = canvas.getContext('2d'); const imageData = ctx.createImageData(1905,405); imageData.data.set(pixels) console.log(imageData); ctx.putImageData(imageData,0,0) document.body.append(canvas) `
Thanks in advance !
Please provide a sandboxed reproduction :)