question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set image from Blob

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cookiegurucommented, Jan 17, 2017

That will work nicely. Thanks for the quick turnaround @mpost!

0reactions
ghostcommented, May 11, 2017

cause I have to login with user and password

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found