File f = new File(imageLocation);
try{
bi = ImageIO.read(f);
}catch (Exception e){
f = new File(imageLocation
);
bi = ImageIO.read(f);
}
respond = "HTTP/1.1 200 OK\r\n";
respond += "Date: " + LocalDateTime.now() + "\r\n";
respond += "Content-Type: image/png\r\n";
respond += "Content-Length: " + f.length() + "\r\n";
respond += "Connection: keep-alive\r\n";
respond += "\r\n";
output.write((respond).getBytes());
output.flush();
ImageIO.write(bi,"JPG",output);
output.flush();
respond = "\r\n";
output.write((respond).getBytes());
output.flush();
Glide.with(context).load(ImageURL).override(50,50).into(holder.image);
i tried to access again with browser and it work fine
if my glide return exception or not
--
You received this message because you are subscribed to the Google Groups "Glide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glidelibrary...@googlegroups.com.
To post to this group, send email to glidel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glidelibrary/dd9423d9-449f-48cf-bf1e-e737ff7e13b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
respond = "HTTP/1.1 200 OK\r\n";
respond += "Date: " + LocalDateTime.now() + "\r\n";
respond += "\r\n";
output.write((respond).getBytes());
output.flush();
Hi, glad it worked out!
>> You're also writing the HTTP response header after the image contents, why?
> Yes, but i send my HTTP response first then my image.
Sorry, yes, I see it now, you repurposed the local variable respond:
> respond = "\r\n";
> output.write((respond).getBytes());
This is what confused me, but still, I don't think you need a new line after the contents, because the image is binary.
+Robi
--
You received this message because you are subscribed to the Google Groups "Glide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glidelibrary...@googlegroups.com.
To post to this group, send email to glidel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glidelibrary/91b1d797-d8b2-4884-80ae-c2f87b4449d7%40googlegroups.com.
> respond = "\r\n";
> output.write((respond).getBytes());This is what confused me, but still, I don't think you need a new line after the contents, because the image is binary.
+Robi