Skip to content

Blurash decode JS draw single line #232

@MaxPtdr

Description

@MaxPtdr

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 !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions