Questions tagged [uint8array]

The Uint8Array typed array represents an array of 8-bit unsigned integers.

162 questions
1
vote
1 answer

Convert [UInt32] -> [UInt8] -> [[UInt8]] in Swift

I am trying to speed up my current implementation of a function that converts [UInt32] to a [UInt8] which in turn is split up into [[UInt8]] with 6 arrays at each index. My implementation: extension Array { func splitBy(subSize: Int) -> [[Element]]…
p0ppy
  • 13
  • 3
0
votes
0 answers

convert png image to File object in typescript

In my test project I want to convert my png image to Uint8Array. I found some solution pngFileToUint8Array(pngPath: string): Promise { const png: File = new File([pngImage], pngPath, { type: 'image/png' }); return new…
Marcin
  • 97
  • 7
0
votes
1 answer

retriving data from Uint8 array

I have a point data in this format Uint8Array (1434544) [170, 189, 128, 65, 141, 54, 182, 65, 218, 50, 12, 192, 61, 247, 134, 194, 242, 169, 128, 65, ...] It is Uint8Array and represent point data of point cloud in format of x, y, z, and i where…
Pravin Poudel
  • 1,433
  • 3
  • 16
  • 38
0
votes
1 answer

why does a Uint8Array() from buffer returns empty?

I am trying to load a font for pdf-lib to use. In order to use it, i must provide a Uint8Array for pdfDoc.embedFont(font); For some reason, whenever i create the UInt8Array, it returns empty. The ArrayBuffer is returning something so i am quite…
0
votes
1 answer

Unable to display Uint8Array in Electron / Nodejs

I've got a big Uint8Array (frame of a camera) encoded in bgra8 that because of reasons I receive as Buffer. I'm adding this information in case someone points out this could be part of the problem: This is the data when sent: This is the code of…
user2952272
  • 361
  • 3
  • 18
0
votes
0 answers

Deno convert bmp image file data into a Uint8Array

I am currently trying to load a .bmp image file with Deno and then convert the data of the image into a black/white Uint8Array. I load the image using: const imageFile = await Deno.readFile('./path/to/my/image.bmp'); This returns me a Uint8Array,…
Mqx
  • 182
  • 7
0
votes
1 answer

Convert JavaScript Uint8Array object into Scala Object

A TypeScript application sends a Uint8Array object through an HTTP POST request to a Scala Play application. How to convert the Uint8Array object into a Scala object in the Play application? For example, the TypeScript code sends the following…
rapt
  • 11,810
  • 35
  • 103
  • 145
0
votes
0 answers

uint8_t element assignment to uint8_t array in C++

I am trying to create a uint8_t array and try to change the first element of the array, then print it to the terminal as a string. But, after I assign currBlock (changed block) to arr[0], cout gives an error. I tried to find the answer in…
sayonara
  • 13
  • 4
0
votes
0 answers

Javascript decode Uint8Array with id3 metadata

I am trying to get id3 metadata from hls stream. I can convert Uint8Array to string but the response is still not readable to me. Is there a way to get more readable response? var o = new…
Toniq
  • 4,492
  • 12
  • 50
  • 109
0
votes
1 answer

Return Uint8Array from function

I'm trying to combine two Uint8Array and return the result in this function commandframe = new Uint8Array([0x01,0x00]); GetCRC16Full(commandframe, true); function GetCRC16Full(cmd, IsHighBefore) { let check= [0xff]; var mergedArray = new…
Vince
  • 15
  • 6
0
votes
0 answers

Convert Uint8Array to a file and save to db

I may be asking the basics just now, sorry. I want to convert Uint8Array back to a file and save it in db. Is there anyone who can help me? document.getElementById('upload_0').onchange = function(event) { var ext =…
0
votes
1 answer

How do I convert a List into a viewable image in Flutter?

sample.json is a file containing a list of values from 0 to 100 under a header called "readings": [ { "id": 105399, "time": "2022-11-22 01:25:23.920", "readings": [ [ 0, 2, …
ianjms
  • 9
  • 1
0
votes
0 answers

In Flutter, image with buffer(Uint8List) is not displaying with Image.memory

From backend server, I received buffer array like belows. { "type": "Buffer", "data": [ 239, 191, 189, 80, 78, 71, 13, 10, 26, ... ] } To receive above data, I created a response DTO like…
Jun
  • 451
  • 4
  • 16
0
votes
0 answers

avoid uint8array object conversion in axios,nodejs

I am trying to send uint8array in Axios payload in POST by doing this app.post('/upload',upload.single('file') ,async function(req, res){ var fileString = fs.readFileSync('./uploads/file.jpeg') var u8 = new Uint8Array(fileString); …
Saurabh
  • 1,592
  • 2
  • 14
  • 30
0
votes
1 answer

Crop byte array image in swift

I am trying to crop image over UInt8 array. Here is the way I've tried: func cropImageArray(byteArray: [UInt8], sourceWidth: Int32, bitsPerPixel: Int32, rect: Int32Rect) -> [UInt8] { var blockSize = bitsPerPixel / 8 var outputPixels =…
fuhr
  • 11
  • 3