Is it possible to replace the image portion of a JPG but keep the embedded metadata? Alternatively, is there a way to reliably copy all metadata from one JPG image to anothe
I think that ImageMagick can help you.
I saw that ImageMagick example where you can see how to extract all metadata from a jpg file.
Now if you have the metadata of the original file, you can create a new file with that metadata. I found a example of how to add metadata with ImageMagick
I hope this can help you