supplierdeeply

Write to EXIF data?

  • 5 Replies
  • 1014 Views
Write to EXIF data?
« on: 22 / August / 2015, 07:02:34 »
Advertisements
Hi,

is it possible using CHDK to write into the images EXIF data?
E.g. if I get the GPS coordinates from an Arduino, can I write it to the EXIF data using CHDK?
(Let's assume there is already a way to submit the GPS data from Arduino into the cam somehow)

So the basic question is can I change EXIF data using CHDK?

Thanks!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

*

Offline srsa_4c

  • ******
  • 3530
Re: Write to EXIF data?
« Reply #1 on: 22 / August / 2015, 13:51:46 »
Ports that support Filewritetask could in theory manipulate the exif before the file is saved. However, finding the exif is not trivial, modifying it would be even harder.

Write to EXIF data?
« Reply #2 on: 22 / August / 2015, 14:39:15 »
There is a script somewhere that  writes into the user comment area of the EXIF info.  Can't search for it from my mobile phone but it's here or on the wiki.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1227
  • A720 IS, SX220 HS 1.01a
    • CHDK inside
Re: Write to EXIF data?
« Reply #3 on: 22 / August / 2015, 15:53:18 »
German CHDK pages:  CHDK forum | CHDK inside | CHDK Twitter News by msl | Download CHDK-DE (Autobuild)
Note: SDM violates the GPL rules!


Re: Write to EXIF data?
« Reply #4 on: 23 / August / 2015, 11:27:24 »
Hi,

thanks, sorry I forgot to mention that I want to do it directly inside the CHDK source code.
Since I am C++ programmer I think this would be much easier for me.
Is there any way to get a pointer to the all image files and insert the EXIF data?

2 x IXUS 860IS 100c
2 x Powershot S110 103a

*

Offline reyalp

  • ******
  • 11084
Re: Write to EXIF data?
« Reply #5 on: 23 / August / 2015, 16:04:23 »
Hi,

thanks, sorry I forgot to mention that I want to do it directly inside the CHDK source code.
Since I am C++ programmer I think this would be much easier for me.
Is there any way to get a pointer to the all image files and insert the EXIF data?
You can read and write files using stdio functions like fopen etc. You can list directories using opendir/readdir (look at the file browser code for examples)

You will need to parse the EXIF yourself.  The tagme lua script may provide a useful example. There's probably some fairly compact, portable EXIF libraries in C out there too. If you find one that ports easily to CHDK, it might be worth including as a module.

Note that there is very limited memory available to CHDK, typically less than 1 MB and sometimes a lot less, so you can't just read an entire image file into RAM.

There is not currently a known way to add entries to the EXIF of an image before it is saved. In theory you could modify data is it is being written in the filewrite hook, but I suspect maintaining the correct structure would be problematic (I haven't looked at it in detail though). It's possible you could find a way to hook into the cameras EXIF process with some reverse engineering.

Personally, I would suggest keeping your GPS data separately and just align later on a PC with image number or timestamp.
Don't forget what the H stands for.

 

Related Topics