This commit is contained in:
seb
2026-10-10 00:25:09 +02:00
parent f2f60d5766
commit 2c36a705c4
3 changed files with 28 additions and 13 deletions

View File

@@ -1,10 +1,11 @@
import { PureComponent } from 'react';
import Box from '@mui/material/Box';
import { thumbHashToDataURL } from 'thumbhash';
import { thumbHashToDataURL, thumbHashToRGBA } from 'thumbhash';
export default class ThumbHashImage extends PureComponent {
constructor(props) {
super(props);
//move this to where it'S loaded
const bytes = Uint8Array.from(atob(props.thumbHash), (c) => c.charCodeAt(0));
this.url = thumbHashToDataURL(bytes);
}