View Single Post
Old 04-19-2005, 05:04 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote