Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Decoding File Encoded as Buffer In Javascript

I am downloading an item from an S3 bucket using getObject. I am able to receive the object as a JSON object with the correct ContentType of 'image/jpeg'. The picture data is encoded as in something I am not familiar with. It starts with

<Buffer ff d8 ff e0 00 10 4a 46

And goes on for a large number of lines. Calling JSON.stringify on the entire object converts the

"type": "Buffer",
      "data": [
        137,80,78,71,13,10,26,10,

I am not familiar with how I should decode this in order to display an image given the ContentType information and the image data. How do I convert the data into an image that I can display using a URL source tag?

I don't want to display the image directly from the source because I am trying to download the image and save it to local storage for display when the user is offline.

The image will be displayed in a react-native application using the component.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You will need to either write it locally, or send it directly using streams with the correct mimetype.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!