Jump to content
  • Advertisement
Sign in to follow this  
Firestryke31

JPEG loading

This topic is 3171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a mostly-personal project that requires me to load a JPEG. Here's the thing, though: I don't care much about the actual image data. Preferably I'd like to be able to tuck it away so I can dump it back into the resulting file unmodified, though in the future I might want to replace the picture data (not sure, though). What I want to do is edit some of the metadata in the image and save it. Could someone suggest a library, preferably C++ but a C one works too, that would let me be able to do this? There are only 2 restrictions: It must be free and it can't be GPL. Short version: I need a free, non-GPL C/C++ library to let me edit the metadata in a JPEG. Bonus points if it will let me change the image if I want to later.

Share this post


Link to post
Share on other sites
Advertisement
libjpeg allows you to do so, but it is quite a low level library. Although documentation is included, you might want to check the code of some higher-level libraries that use it to get the feel of how it is supposed to be used, such as SFML or DevIL.

Share this post


Link to post
Share on other sites
I was hoping to change some of the metadata in the APP14 marker section, because some data gets stored there that some people would like to change. This data is stored in a semi-proprietary way (basically a derivative of Photoshop's APP14) and I'm willing to handle that myself. It's being able to handle the rest of the JPEG that's being problematic for me.

Share this post


Link to post
Share on other sites
Quote:
Original post by Firestryke31
I was hoping to change some of the metadata in the APP14 marker section, because some data gets stored there that some people would like to change. This data is stored in a semi-proprietary way (basically a derivative of Photoshop's APP14) and I'm willing to handle that myself. It's being able to handle the rest of the JPEG that's being problematic for me.


Then I second fcoelho's suggestion of libjpeg.

Share this post


Link to post
Share on other sites
I've downloaded and am looking at libjpeg. So far the only gripe I have is that it's not C++, but I'm positive I can handle that. While I'm still here, could someone point me at a tutorial for using the library so my lazy butt doesn't have to Google it (or we could go with the "to help keep information together for the others that might read this thread" excuse)?

Edit:
Here is a nicely formatted version of the documentation included with libjpeg's download. It was good enough for me, but I've heard that others found it lacking. More tutorials would still be appreciated, specifically for read-modify-write operations.

[Edited by - Firestryke31 on October 16, 2009 3:13:50 PM]

Share this post


Link to post
Share on other sites
It's a shame that there's no mailing list for the library. The current maintainer's website is http://jpegclub.org/. His email is at the bottom and he was responsive to the detailed questions I had about the library a couple of months ago.

You'll find that the vast majority of other open source JPEG libraries are wrappers around the libjpeg and so despite the library's relative opacity, it is probably your best bet.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!