Open realtebo opened 2 years ago
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
I've this snippet reading a png
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
I need to obtain in some way pngData or a Uint8ClampedArray