tags:

views:

545

answers:

4

I am having a bit of a problem.

I get a RAW char* buffer from a camera and I need to add this tags before I can save it to disk. Writing the file to disk and reading it back again is not an option, as this will happen thousands of times.

The buffer data I receive from the camera does not contain any EXIF information, apart from the Width, Height and Pixels per Inch.

Any ideas? (C++)

+1  A: 

What's the difference? Why would doing it to a file on the disk be any different from doing it in memory?

Just do whatever it is you do after you read the file from the disk..

shoosh
A: 

As far as I know EXIF data in JPEG is continuous subpart of file. So

  1. prepare EXIF data in memory
  2. write part of JPEG file upto EXIF
  3. write prepared EXIF
  4. write rest of JPEG file
Jakub Kotrla
+4  A: 

Look at this PDF, on page 20 you have a diagram showing you were to place or modify your exif information. What is the difference with a file on disk ?

Does the JPEG buffer of your camera contain an EXIF section already ?

shodanex
No the JPEG buffer from the camera does not contain the EXIF section
Hannes
Thanks. This helps...it differs from the JFIF standard
Hannes
+1  A: 

You might want to take a look into Exiv2 library. I know it can work on files but I suppose it also has functions to work on memory buffers.

Marcin Gil