TagMe.lua : mark images by writing your own keyword to EXIF tag - page 2 - LUA Scripting - CHDK Forum

TagMe.lua : mark images by writing your own keyword to EXIF tag

  • 25 Replies
  • 26734 Views
*

Offline an0n

  • ***
  • 152
Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #10 on: 24 / November / 2009, 09:47:23 »
Advertisements
Adobe Bridge is another application you can use, with Edit>Find...>, use All Metadata as the criteria.
A720IS.

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #11 on: 24 / November / 2009, 09:52:37 »
thanks for the advice, an0n. I did get EXIFTool to work on the mac.

I'm also eager to try to edit/add other EXIF fields. If anyone else is interested we should combine efforts.

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #12 on: 24 / November / 2009, 14:05:44 »
Quote
I'm also eager to try to edit/add other EXIF fields. If anyone else is interested we should combine efforts.

Hi mattkime,

What EXIF fields do you have in mind?

Originally I tried to incorporate more that just the UserComment EXIF tag but the code became quite big so I decided to go with one tag first and see what other people might ask for.
Canon PowerShot SX10 IS, CHDK 1.03A

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #13 on: 24 / November / 2009, 14:17:30 »
i guess my central curiosity is what it takes to create arbitrary EXIF tags. Is such a thing possible? It would be nice to log the temperature reading from the camera into EXIF tags. I could imagine doing something similar with various scripting vars. Of course, I could also put all this info into the UserComment tag.

I need to give this a try on my a650 doing timelapse over an eye-fi card. I'm curious to see if the image modification confuses the card.


Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #14 on: 24 / November / 2009, 18:51:27 »
Quote
i guess my central curiosity is what it takes to create arbitrary EXIF tags. Is such a thing possible?

I don't think you can have arbitrary tags. All EXIF tags have their own unique tag ID (e.g. UserComment tag ID = 37510) as specified in the "Exchangeable image file format for digital still cameras: Exif Version 2.2" specification.

I suggest you write the temperature between two html like tags in the UserComment. Something like this:

<temp>23.4</temp>

You then can use a simple pattern matching script to extract the temperature quite easily without coding a complex EXIF tag parser. Just use the pattern matching capabilities available in Lua (you run this script on your PC after downloading the images from the camera):

Code: [Select]
sourceFileName = "IMG_0032.JPG"

print("reading file "..sourceFileName)
local f = assert(io.open(sourceFileName, "rb"))
local data = f:read("*all")

s = string.sub(data, string.find(data, "<temp>(.-)</temp>"))
temp = string.gsub(s, "<temp>(.-)</temp>", "%1")
print("temperature : "..temp)

Regards
stift



Canon PowerShot SX10 IS, CHDK 1.03A

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #15 on: 28 / November / 2009, 21:47:36 »
I'm curious if anyone knows how to use EXIFTool to extract a single field.

---

I'm successfully modifying the User Comments field in my own script. I'd recommend adding the following function -

function DirectSetUserComment(image,comment)
     local jpg = JPEGImage
     jpg:new(image)
     jpg:SetUserComment(comment)
end


I suspect that this library will largely be used to set values rather than read them, or read and then modify them.

Unfortunately problems with my Eye-Fi card is preventing me from testing with it. Otherwise I've been able to do exactly what I've tried.

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #16 on: 01 / December / 2009, 20:10:22 »
>>I'm curious if anyone knows how to use EXIFTool to extract a single field.

I'll answer my own question -

exiftool -usercomment

-k is helpful if you're on windows, rather annoying if you're on mac

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #17 on: 19 / May / 2010, 03:59:20 »
I think this is a great script... because we make a lot of photos, but is very difficult to organize all of them without a lot of effort.

I have a Canon A620. I try to run this script, and it looks like it works, but at the end, there is no "comment"  tag into the Exif data of the photos... :(

Can you tell me if any of you have tested it in an A620? and if it works?

Anyone knows why it does not work in my camera?

Thanks in advance for your answer... And cheers...


*

Offline fe50

  • ******
  • 3147
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #18 on: 19 / May / 2010, 05:06:13 »
I have a Canon A620. I try to run this script, and it looks like it works, but at the end, there is no "comment"  tag into the Exif data of the photos... :(

Did you inspect the right EXIF data field, e.g. with exiftool -usercomment ?
The EXIF data sometime will not be displayed correctly / complete with some viewers / applications - which apps do you use to view the EXIF data ?

Re: TagMe.lua : mark images by writing your own keyword to EXIF tag
« Reply #19 on: 19 / May / 2010, 09:21:38 »
Did you inspect the right EXIF data field, e.g. with exiftool -usercomment ?
The EXIF data sometime will not be displayed correctly / complete with some viewers / applications - which apps do you use to view the EXIF data ?

Thanks a lot for your answer....

I've checked the EXIF data with XNVIEW and it does not appear. I've checked the jpg image that is in this thread  (some posts before), and I can see it.

When I run the script, it tells me that the images are updated ... it goes one by one modifying them... but after all the EXIF tag is not into the files.

It's a pitty, cause I think this is a "must have" script to orginize them without any other soft...

I hope that the Keyboard script that I read into another post can be implemented to modify files, and after this we can modify the labels "on travel".

 

Related Topics