pl-fe: zoomable image fixes

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-01-22 23:41:05 +01:00
parent c708ba2a3f
commit d37c602555
2 changed files with 7 additions and 4 deletions

View File

@ -40,10 +40,12 @@ const Blurhash: React.FC<IBlurhash> = React.memo(({
try { try {
const pixels = decode(hash, width, height); const pixels = decode(hash, width, height);
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
const imageData = new ImageData(new Uint8ClampedArray(pixels), width, height); const imageData = ctx?.createImageData(width, height);
imageData?.data.set(pixels);
if (!ctx) return; if (imageData) {
ctx.putImageData(imageData, 0, 0); ctx?.putImageData(imageData, 0, 0);
}
} catch (err) { } catch (err) {
console.error('Blurhash decoding failure', { err, hash }); console.error('Blurhash decoding failure', { err, hash });
} }

View File

@ -7,7 +7,8 @@
} }
.-zoomable-image { .-zoomable-image {
@apply relative flex size-full items-center justify-center; @apply relative flex size-full items-center justify-center overflow-hidden select-none;
scrollbar-width: none;
&--zoomed-in { &--zoomed-in {
@apply cursor-grab z-[9999]; @apply cursor-grab z-[9999];