When reading .bmp/.tiff you basicaly read a header, defining image size/color palete and the like, the rest of the image you just read in a steady stream, not much conversion/decompression of any kind, virtualy any imagelibrary provide buildin support for those kind.
With .jpg you read a header, telling image size, color palete, compression rate, and from that moment on you read a compressed image, here is a small representation:
Code:
0 represents black
1 represents white
Orriginal image:
11111111000011111011111000000111
Compressed image:
8x1;4x0;5x1;1x0;5x1;6x0;3x1
Thus when reading the image you won't read the lines of 1 and 0 and display as read, which you would with .bmp/.tiff, but instead you read the compressed portion, which is declared by the compression rate from the header.
If at some point the read algorithm isn't supporting the compresssion which the header tells it to use, you'd end up with an error like the one you describe.