JPEG loader?

I plan to use jpeg pictures as textures.
Does anyone know where i could get a simple (like 100-200 rows code) example on how to load a jpeg?

Hi Humus!

There is a public available library that does the jpeg stuff. I’ll used it before, but I can’t remeber the URL in the moment, so stay tuned. I’ll beem it up, when I dig it up.

Regards,

LG

And may the vector be with you!

wanna code, humus?
i can give my CdmyImage class, wich loads various formats.
if jpg is all you need, you can rip the code from it.
it uses the intel jpeg library.

Dolo//\ightY

Yes please, i want that class. It doesn’t make it worse if it supports more formats, it’s just great!

Could you send it to me?
emiper-8@student.luth.se

Thanks / Humus

hi dmy,
could you send it to me,too?
sebastian_posch@c4.com

thanx!

I need it too
pburslem@bellsouth.net

I’ll take 2!!!

rolfewiz@yahoo.com

Me too!

ashfordmail@beeb.net

Search Intel’s web site for their JPEG library, called ijl (Intel Jpeg Library). With this library it is really easy to write your own JPEG reader!

Kosta

You might as well use the Jpeg Independant Group JPEG Library… I haven’t tried Intel one (always used the JIG one) but perhaps it is easier to understand…

Eric

I’d personally stick to the JIG lib, due to it’s portability to other platforms, and the fact that it’s more flexible. It allows you to read JPEG data from memory or from an ANSI standard file stream. Intel’s allows memory reads only (Or so I think).

Originally posted by fenris:
I’d personally stick to the JIG lib, due to it’s portability to other platforms, and the fact that it’s more flexible. It allows you to read JPEG data from memory or from an ANSI standard file stream. Intel’s allows memory reads only (Or so I think).

No, you can read and write from/to memory AND files (entry JPGFile in struct JPEG_PROPERTIES).
By the way, a neat feature of the IJL is the possibility to decompress only a sub-image of a JPEG-image.

Kosta

I must be the 10th person that asks you this, but could you send me your PIC loader class ?

I can’t use the JPEG lib with my compiler, there is always a linkage error which I cannot solve.

thanx in advance.
Prekipik

my mail: prekipik@club-internet.fr

Personally I think JPEGS are evil when you map them onto objects. Their lossy compression works well for skin tones and stuff but for ‘pure’ colours, it just plain sucks.

There was a .png loader floating about somewhere - I recommend that…

Not exactly source code, but I have an excellent jpg library for OpenGL (aptly named mkOpenGLJPEGImage). Have a look at
http://math.ucsd.edu/~mkennedy/software if

you’re interested.

You can find something free and with source code here http://shiptech.tuniv.szczecin.pl/~weyna/OpenGL/

I agree with Pauly’s post that JPEG images do not result in high quality texture maps.

Having said that, I’ll note that a link to the IJL can be found in 24.050 of the OpenGL Technical FAQ.

You guys should check out the discussion the recently went on in the OpenGL Game Dev mailing list about using JPEGs as textures! Look on www.egroups.com under opengl game dev list and find the messages with the subject ANNOUNCE: mkOpenGLJPEGImage Class.

Enjoy,
Michael