There is a lot of work between reading a "JPEG file" and getting to the pixel data.
If you are really interested, I suggest starting with one of the many JPEG dump programs that are out there to learn about the structure of the the JPEG stream. A JPEG stream consists of a sequence of markers.
The compressed data is in the scans. In progressive JPEG, multiple scans have to be combined.
The basis sequence of decoding is run-length/huffman, DCT, sampling, conversion to RGB.
That's a lot of code to get to that point.