View Full Version : how to read a jpg image?
05-06-2002, 02:33 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif
05-06-2002, 02:36 AM
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.
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.
05-06-2002, 04:37 AM
yes jpegs are hard to read, as they are compressed. if you feel you can handle it, go to wotsit (http://www.wotsit.org) to read the jpeg format.
05-06-2002, 05:32 AM
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.
05-06-2002, 08:43 AM
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.
05-06-2002, 02:26 PM
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.
05-06-2002, 02:29 PM
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)
05-06-2002, 06:26 PM
You can try
I saw this on the current news page at this site today.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.