GIF and JPEG decoding

Where can I find source-code to view gif's or jpeg's (I prefer JPEG of course)
I already have some code, but it is full of assembler-code and I don't like
assembler that much ...
I'm just looking for a procedure in which the only screen-routine used is
something like putpixel(x,y,color:word) (the procedure should only worry about
decoding the picture and do no graphical routines)

P.S. I already have code to initialize graphics or to put a pixel in 256-color
mode, but that's not the problem.

P.P.S. Of course all source is welcome (even if they are full of assembler)