So I have been looking into how Qt does image encoding. Currently I am able to encode text into an image using the framework classes and have demonstrated that it works with a sample app. Looking around the Git repository for Qt, I found that they have a third party tools folder that contains all the external libraries they use. This folder contains the libjpeg and libpng folders, among others. So it is safe to assume that Qt uses these libraries to encode these two file formats.
This document in the repository provides some instructions on how to use the library. It contains the comment section that shows us how to write a comment into a jpeg. The following line is used to write a comment:
wrjpgcom -comment "some text" [inputfilename]
However, since everyone is working with the xmp toolkit and trying to get it to work on Android. I started with that as well. I got the Android version of the tool kit to compile to compile and am working on an app that will hopefully use the library.