Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blurash decode JS draw single line #232

Open
MaxPtdr opened this issue Feb 15, 2023 · 1 comment
Open

Blurash decode JS draw single line #232

MaxPtdr opened this issue Feb 15, 2023 · 1 comment
Labels
needs reproduction question Further information is requested

Comments

@MaxPtdr
Copy link

MaxPtdr commented Feb 15, 2023

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 !

@Thisen
Copy link
Collaborator

Thisen commented Mar 30, 2023

Please provide a sandboxed reproduction :)

@Thisen Thisen added the question Further information is requested label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants