The JPEG byte editor we've got will extract the header, remove it, and allow you to edit just the body. We do this by checking for the SOS (start of scan) marker, which is FFDA or 255 218.
But if the JPEG contains a thumbnail, there will be two SOS markers, since the stored thumbnail is itself another JPEG image. This will incorrectly append another body, so it leads to a lot of extra bytes that don't change the image at all.
We can get around this by just having all our sample JPEGs not include a thumbnail, but to make it work for any user supplied JPEG this would be nice to do.
The JPEG byte editor we've got will extract the header, remove it, and allow you to edit just the body. We do this by checking for the SOS (start of scan) marker, which is
FFDA
or 255 218.But if the JPEG contains a thumbnail, there will be two SOS markers, since the stored thumbnail is itself another JPEG image. This will incorrectly append another body, so it leads to a lot of extra bytes that don't change the image at all.
We can get around this by just having all our sample JPEGs not include a thumbnail, but to make it work for any user supplied JPEG this would be nice to do.