Grabbed damege photo from Adafruit TTL Camera

As what title says, I’ve successfully go through all the process from photo capture to upload to my web server host , but only problem which is the damage photo. Does anyone have any ideas about it? I’ve put one of my damage photo here for your guys to see what happen.

By the way , are there any site which good at photo streaming for free?

Looks like you haven’t got the whole file. If you share your code, maybe we can help you see where the rest of it went.

In terms of the code I’m just using the library and fit it with my server host url like this.

`const MY_SERVER_URL = “myurl/upload.php”;

requests <- []

jpeg_buffer <- null

device.on(“jpeg_start”, function(size) {
jpeg_buffer = blob(size);
});

device.on(“jpeg_chunk”, function(v) {
local offset = v[0];
local b = v[1];
for(local i = offset; i < (offset+b.len()); i++) {
if(i < jpeg_buffer.len()) {
jpeg_buffer[i] = b[i-offset];
}
}
});

device.on(“jpeg_end”, function(v) {
local s = “”;
foreach(chr in jpeg_buffer) {
s += format("%c", chr);
}
local req = http.post(MY_SERVER_URL, {}, s);
req.sendsync();
foreach(res in requests) {
res.header(“Location”, “myurl/camera.jpg”);
res.send(302, “Found
”);
}
server.log(format("Agent: JPEG Sent (%d bytes)"s.len()));
});

device.on(“something”,function(req) {
device.send(“take_picture”, 1);
requests.push(res);
});`