Javadoc
This function tries to extract the subsampling information from the JPEG image using
either 'SOF0' or 'SOF2' segment.
The structure of the 'SOF' marker is as follows.
- data precision (1 byte) in bits/sample,
- image height (2 bytes, little endian),
- image width (2 bytes, little endian),
- number of components (1 byte), usually 1 = grey scaled, 3 = color YCbCr
or YIQ, 4 = color CMYK)
- for each component: 3 bytes
- component id (1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q)
- sampling factors (bit 0-3 vertical sampling, 4-7 horizontal sampling)
- quantization table index