Hi , attach screenshot is response of some api to ...
# squarelibraries
m
Hi , attach screenshot is response of some api to get image , my question is how to parse this response and display it in imageview thanks response header for Content-Type is application/octet-stream i tried this but i does not work though it return bytes but bitmap val is null
Copy code
@GET("users/profile/photo")
suspend fun getProfilePhoto(@Header("Authorization") authorization: String  ): ResponseBody

  val response = getClient().getProfilePhoto()
  val bytes: ByteArray = response.bytes()
  val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
  Glide.with(this@MainActivity).load(bitmap).into(image)
Thanks
b
Is Glide a square library?
s
Glide and other image libraries should be able to take in an InputStream directly for loading bitmaps, but I agree this isn't a question for #squarelibraries and you'll find better luck in #android or on stackoverflow.