Add Geo tag to jpeg in Lua

189 Views Asked by At

I have been working hard on understanding EXIF data parsing but there is something I cannot figure out.

My goal is to write a Lua code I can run in my FlashAir card in order to write the GPS location info.

What I cannot figure out is if writing a tag that did not previously exist requires to shift the bytes in the position where I have to insert the missing tag.

I compared the same image after and before adding the tag with a software and they look exactly same size. This would mean that the EXIF header allocates the space for all expected headers regardless they are defined or not.

If the GeoTag is missing I think I just need to update the counter of the IFD0 and place the tag identifier for GPS in the right place and from there I put all the info in the right bytes.

Do you guys know how the insertion of Geo tag should be handled? I will use Lua (at least I will try) so I have to work at byte level....I did not find any lib that does what I need yet...

0

There are 0 best solutions below