Page 1 of 1

Raw Image to JPEG with metadata

Posted: 2015-07-23T02:04:52-07:00
by hustmark
hi,
I am very new here, i want to convert RAW image(like .CR2 file,.NEF file) to JPEG image with metadata. I write code as follows:
Image image;
image.read("RAW_NIKON_D7000.NEF");
image.write("test.jpg");
I get a test.jpg file in my computer,but there is no metadata(like ISO Speed,lens type, Aperture value...)in test.jpg file.
Question 1: How can I get a jpeg file with metadata?
Question 2: Can I use ImageMagic library to get the DCT coefficients information from JPEG file?

Re: Raw Image to JPEG with metadata

Posted: 2015-07-23T05:20:45-07:00
by snibgo
IM ignores most metadata. Use exiftool for that.

Re: Raw Image to JPEG with metadata

Posted: 2015-07-23T06:37:40-07:00
by hustmark
snibgo wrote:IM ignores most metadata. Use exiftool for that.
But exiftool is a command line program. I want to convert raw image to JPEG image using c++ code. How about the second question above?

Re: Raw Image to JPEG with metadata

Posted: 2015-07-23T07:19:38-07:00
by snibgo
Command-line programs can be called from with C++ programs. Perhaps there is a library for exiftool (or similar) that can be linked.

I don't know how to get DCT coefficients, or whether IM can do this. You might need to talk directly to the JPEG library.