-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
I've this snippet reading a png
<?php
$file_name = './ReactNative-snapshot-image6513693026486043647.png';
$image_file_content = base64_encode(file_get_contents( $file_name ));
$image_size = getimagesize( $file_name );
?>
I need to convert the png to a Uint8ClampedArray (to decode a QRCode client-side, long story)
Is there a way using your lib to get file content from a base64 string?
For instance, I am doing a similar thing using jpeg-js
const jpegData = Buffer.from("<?php echo $image_file_content ?>", 'base64');
const rawImageData = jpeg.decode(jpegData);
const clamped_array = Uint8ClampedArray.from(rawImageData.data);
const decodedGreenpass = window.jsQR(
clamped_array,
<?php echo $image_size[0]; ?>,
<?php echo $image_size[1]; ?>
);
I need to obtain in some way pngData or a Uint8ClampedArray
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels