Set image from Blob
See original GitHub issueI have a use case where I’m loading images from a remote server and I need to display some additional metadata about the image. Currently, this requires performing two requests–one to load the image and another to fetch the metadata. Since I control the remote host, I’d like to send additional HTTP headers with the image that contain the metadata. With the fetch
API, I can get the image data as a blob and retrieve the custom headers as text. From there, it would be great to be able to set the ImageView
’s source to that blob data and (for example) a TextView
with the value of the custom header.
Alternatively, if there was a way I could access the okhttp
response object (and its equivalent on other platforms), that would work too.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Using JavaScript to display a Blob - image - Stack Overflow
var image = document.createElement('image'); image.src = 'data:image/bmp;base64,'+ ...
Read more >Blob - The Modern JavaScript Tutorial
We can't change data directly in a Blob , but we can slice parts of a Blob , create new Blob objects from...
Read more >Convert a blob to an image with JavaScript (e.g. ... - Github-Gist
Convert a blob to an image with JavaScript (e.g. to render blob to canvas) - blob-to-image.js. ... blob-to-image.js. const blobToImage = (blob) =>...
Read more >Convert A Blob To A File Using JavaScript - PQINA
The script below converts a fetch response into a Blob . ... fetch('./image.jpeg') .then((res) => res.blob()) .then((myBlob) => { console.log( ...
Read more >Display images stored in a BLOB field - Microsoft Learn
This article introduces how to display images stored in a BLOB field.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That will work nicely. Thanks for the quick turnaround @mpost!
cause I have to login with user and password