TIL that JPEG encoding in the wild is even more complicated than the very complicated documentation makes it out to be. For example, most references I can find say that the difference between an RGB and a CMYK jpeg is the former will have 3 "components" and the latter 4. This in theory should be encoded in a particular start-of-frame byte. And yet I have seen images detected as CMYK by ffmpeg have "03" in that byte position. And there are reports of CMYK jpegs that are really RGB under the hood?
@darius If so, that'd be super annoying. We sorta rely on CMYK jpegs for printing...