Hi,
I did look at the new frames and my old code again, it doesn’t handle several different images so the input file need to be filtered accordingly. I did manage to get almost the full image as seen above.
However, I think the image transmission format is a bit hard to implement, especially from DB. First off, the counter goes down so addressing with this becomes inverted. Second, even if most frames are 246B long, the last two frames (0 and 1) are not full length, which means you cannot use the counter as file position in the inverted counter*length format. You need to put the highest frame at position zero.
I need to rethink it, for now I think this could work:
- detect FFD8FF and get the highest frame count from that frame
- extract frames to list with counter as index
- yield/return array when encountering FFD8FF and a different highest frame count, indicating a new image.
The image processing then needs to loop through the list(s) and assume length 246 and use the length field when available, this to avoid zero padding.