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.
You will need to either write it locally, or send it directly using streams with the correct mimetype.