how to read a jpg image?

I suppose it must be easy for you, but I didnt find anything…
Could you give me a link or a program that reads and draws a jpg image?
I work with Visual C++.
Thank you very much.

Hi !

Reading a jpeg image is pretty messy so you should go for a library that can handle it for you, I don’t know of any one that works with C++, but I am pretty sure you can find one, at least if you are ok with a GPL or LGPL license. Give google a try.

Mikael

IMHO, the best way to load textures is to use an underlying library like SDL to interface with OpenGL, then use a seperate library (like SDL_image) to load all your textures.

yes jpegs are hard to read, as they are compressed. if you feel you can handle it, go to wotsit to read the jpeg format.

b

http://www.ijg.org/

Note: though the main page of that site does not say so, the library they have also supports decompression. And the use of this library is not bound by any restrictive license. Your only requirement is to say you are using it.

DevIL’s the one that I use. http://sourceforge.net/projects/openil/ It can load just about any image file format you’d ever want, and the API is as simple as hell.

I think when they compiled it, they used the libs from http://www.ijg.org/ to do Jpegs, though.

www.robals.com/easyjpeg

devIL is good, if they could decide on a name once and for all.

Personally, I’m still an old stand by of the best way to do anything is to do it yourself, but JPGs are such a hassle, it’s just so much easier in this case to use pre-written code.

The important thing is understanding how the file works.

  1. Use photoshop to convert it to a .bmp
  2. Load it using less complicated .bmp software.

(This is what I do. You may not be able to)

You can try
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg1.htm

I saw this on the current news page at this site today.

enjoy,
jpummill