The jpeg-xmp package contains the C source of four programs:

insert XMP metadata into a JPEG file
insert application data into a JPEG file
extract XMP metadata from a JPEG file
extract application data from a JPEG file

The xmptool package contains one program:

query, insert or delete a property in an XMP file

jpegxmp is a Bash shell script:

Set or modify common metadata properties in JPEG files

Use rdjpgxmp to extract the XMP data from a JPEG/JFIF file, use xmptool to query or update that XMP data, then use wrjpgxmp to put the XMP data back, e.g.: rdjpgxmp file.jpg | xmptool -w '' 'value' | wrjpgxmp file.jpg >newfile.jpg. The jpegxmp script is a wrapper around these to make the most common operations easier.

For more info on XMP/RDF, see: