I've been trying to decode raw image data from an image url for a chrome extension using jpeg-js. The current code looks this.
var res = await axios.get("https://cdn.fileinfo.com/img/ss/lg/jpeg_43.jpg");
console.log("response", res);
var buf = Buffer.from(res.data, 'binary');
console.log("buf", buf);
var pixels = jpeg.decode(buf, true);
I keep getting the error "SOI not found" decoding the jpeg. The contents of buf look something like
[253, 253, 253, 253, 0 ,16, 74, ...]
The raw image data has "JFIF" after some junk.
Are the SOI values (255, d8, 255) not included when an image is being setn over http? Or is the image encoded in some other way that I'm not understanding?
Thanks!