LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing/Adding EXIF Data

Anyone familar with a technique/tool to edit/add EXIF data to a JPG file?  I am writing an application for user interface testing that has an attached webcam, and want to create/write the EXIF Comment field with information about where in the test the picture was taken, operator name, test version, DUT information, etc. so we can track "stray JPG" files that show up in our inbox without the rest of the test data.

 

I have seen the post on reading EXIF data (forums.ni.com) that points to the JHEAD application (JHEAD), but this tool won't allow adding anything other than date/time and a thumbnail.

 

Joe Gerhardstein
Viasat
Certified LabVIEW Architect
Certified TestStand Developer
Certified Professional Instructor
http://www.viasat.com
Message 1 of 10
(6,095 Views)
It seems as if EXIF is data is simply a header that is embedded in the JPG itself.  If you can figure out the structure of the JPG and it's header, you can simply read the JPG as a binary file and extract the info manually.
0 Kudos
Message 2 of 10
(6,068 Views)

Hi Joe,

 

EXIF is rather easy to decode, and all manuals you need are online for free.

Once I made my own small tool to rename my digital camera pics automatically from something like "IMGxxxxx.JPG" to "YYYYMMDD_HHMMSS_number.jpg" based on EXIF information...

 

Or you search for some command-line tools that allow writing all those information to the EXIF/JPG. I'm sure there are also several for free!

Message Edited by GerdW on 07-06-2009 09:53 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(6,056 Views)

David:

 

I agree that it is just a header, and Wikipedia has a bunch of clues where to head.  However, this looks like one of those standards-but-not-standard things, where everyone does it a bit different.  For example, Windows has an EXIF editor available via DLL, but there are several accounts of it having problems and corrupting pictures when used for more than reading the EXIF data. So when you look below the surface, it doesn't look like this is as easy as one would think.

 

I guess I was hoping that someone (NI, Lava?) had written a VI to do this and I just wasn't smart enough in my searches to find it.

Joe Gerhardstein
Viasat
Certified LabVIEW Architect
Certified TestStand Developer
Certified Professional Instructor
http://www.viasat.com
0 Kudos
Message 4 of 10
(6,052 Views)

Hi Joe,

 

yes, things might get complicated when you start to build your own EXIF header for Jpegs.

For my Canon camera I found the possibility to embed a string of upto 200 chars without needing to change any structures in the EXIF header - this may be an option for you too...

Hint: you have to search for the "user comment" (or similar, don't have the manuals available) entry  in the EXIF header.

Message Edited by GerdW on 07-06-2009 10:19 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(6,050 Views)
I do not know of any EXIF functions that are native to LabVIEW or that anyone has written yet.  However like I mentioned you can parse it manually and create an example/library for doing this and then post it on the community for others to use in the future. 
0 Kudos
Message 6 of 10
(6,026 Views)
Another optionis is to use a command line utility, like ImageMagick, to do the job for you and call it from LabVIEW using System Exec.
0 Kudos
Message 7 of 10
(5,986 Views)

Hmmm, It looks like no one has taken up this task.  Too bad, as it would be great to take the GPS location from a serial port and add it to the JPG Exif header information collected from my video camera.  Sounds like a great student project........

Andre

 

0 Kudos
Message 8 of 10
(5,790 Views)

Hi Andre,

 

Did you found your student who solved the read/write GPS data in the EXIF section of an image? That‘s exactly what I‘m trying to do at the momment. Although pros here in the forum says it‘s easily done, me as a none SW-Guru don‘t proceed at all.

Anyone else who can support how to edit/add gps data of an image?

Any help appreciated! 🙂

 

urs

0 Kudos
Message 9 of 10
(4,037 Views)

Hey Sapiophile,

 

I was able to find a few resources that might be helpful for you! I have attached them below.

 

How to get exposure values(aperture and exposure time) of pictures?

https://forums.ni.com/t5/LabVIEW/How-to-get-exposure-values-aperture-and-exposure-time-of/td-p/24556...

 

readout exif tag - image number

https://forums.ni.com/t5/LabWindows-CVI/readout-exif-tag-image-number/td-p/534192

 

Extract metadata from jpg? (date picture taken)

https://forums.ni.com/t5/Machine-Vision/Extract-metadata-from-jpg-date-picture-taken/m-p/870898#M222...

 

Image Resize and Image Convert function (.NET) Using LabVIEW

https://forums.ni.com/t5/Example-Programs/Image-Resize-and-Image-Convert-function-NET-Using-LabVIEW/...

 

Also, the thread you are commenting on is pretty old. You might want to make a new forum post. This new post will have more exposure to active users of the forums, resulting in more people seeing your question and  potentially better conversation with other users. I would suggest posting in our Machine Vision forum to get more targeted community assistant on this! Here is the link below.

 

MACHINE VISION

https://forums.ni.com/t5/Machine-Vision/bd-p/200

Gerald M.
Applications Engineer
NI
0 Kudos
Message 10 of 10
(4,014 Views)