# Changing Capture Date on Scanned Images



## orleyd (Jan 1, 2011)

My desired outcome is to change the DTO on scanned image files (large tif master files) to match the time the photos were taken.  I'm familiar with the change capture time feature which works fine for one image but when selecting a batch to re-date, it does a relative time offset against the DTO.

After trying A Better Finder, which seem to work fine to batch reset the Date Created in Finder, but doesn't  alter the DTO when I read the file in LR or CS5 Bridge.  Exiftools seems to be beyond my skill set.  I'm not opposed to using another software tool to get the dates right if it is user friendly for someone who isn't into Terminal and machine code.

I had hoped to select a number of images from the same historical event such as Christmas 1992, put them in a collection, manually sort them in order of occurrence and then batch reset the time to allow sorting by capture time to put them in order for printing.

I'm using LR 3.3, Mac Pro.


----------



## Victoria Bampton (Jan 5, 2011)

Hi orleyd, welcome to the forum!

As you've noted, LR isn't really ideal for that.  My first thought would be exiftool, as you've mentioned, but I'll bump your thread in case anyone else has any better ideas for Mac GUI software.


----------



## Bruce J (Jan 6, 2011)

orleyd said:


> My desired outcome is to change the DTO on scanned image files (large tif master files) to match the time the photos were taken.  I'm familiar with the change capture time feature which works fine for one image but when selecting a batch to re-date, it does a relative time offset against the DTO.
> 
> After trying A Better Finder, which seem to work fine to batch reset the Date Created in Finder, but doesn't  alter the DTO when I read the file in LR or CS5 Bridge.  Exiftools seems to be beyond my skill set.  I'm not opposed to using another software tool to get the dates right if it is user friendly for someone who isn't into Terminal and machine code.
> 
> ...


 
orleyd:

I do exactly what you are asking about using exiftool on a PC.  I'm not current on Macs, so can't help w/ that part, but it's really not as complicated as it seems.  Before you start to modify metadata outside of LR, be sure to write all LR metadata to the file (metadata/save metadata to file) and close LR.  Here's the contents of a batch file that I use to add data to a set of scanned images:

# ExifTool option file for adding data to scanned files

 -AllDates=2005:04:20 12:00:00-04:00
 -Make=NIKON CORPORATION
 -Model=NIKON N80
# -FocalLength=55
# -FocalLengthIn35mmformat=55
# -LensMake=Micro-Nikkor
# -LensModel=55mm f/2.8
# -MaxApertureValue=2.8
# -Lens=Micro-Nikkor 55mm f/2.8
# -LensInfo=55 55 2.8 2.8
# -ExposureTime=1/500
# -FNumber=5.6
 -ISO=100

The file is a simple text file, named scan.txt and it is invoked with the following command line:

exiftool(-k [email protected] scan.txt).exe

The #'s at the beginning of most lines prevent those lines from being processed.  I'm running WinXP, and the way I run the program is to make a desktop icon that invokes the command line, above.  Then, I adjust the data in scan.txt to reflect what I know about a group of images.  If I know anything about the camera, lens, etc., I add that data and remove the # from that line.  Save the modified scan.txt file and then select the images in the OS and drop the selected set if images onto the desktop icon.  It's a bit tedious for large numbers of images that have differing data, but it does work.  

After making the changes to the scanned files, open LR again and read metadata from the file (metadata/read metadata from file) to get the information into the LR catalog.  The setup that I use makes a copy of the original file before adding the new metadata.  After you are sure that it has processed correctly, you can remove the saved originals.  Copy a couple images to a test directory and give it a try; I think you'll get the hang of it fairly quickly.  Good luck,


----------



## Victoria Bampton (Jan 7, 2011)

Someone on another forum mentioned some plug-in writers were using exiftool in their plug-ins.  I wonder if someone could write a LR plug-in to put capture times in scanned images using exiftool?  John?


----------



## johnbeardy (Jan 7, 2011)

Given what I have done so far, it's probably not a difficult job. I'll have a think!


----------



## johnbeardy (Jan 7, 2011)

Quick update - I've got something working. It'll require a bit more testing, but why don't people say what they might like in a "quick and dirty" plug-in.


----------



## Victoria Bampton (Jan 7, 2011)

Wow, that was quick John!  That'll be brilliant - I've got a series of scans to do myself, and we seem to be asked about adding dates to scans quite often.  I'd be primarily interested in just being able to assign a single date to all selected photos, which we can't do in LR unless you've scanned them all on the same day.


----------



## johnbeardy (Jan 7, 2011)

Quick because as you may have heard I have a plug-in that is much more complex and I just needed to chop stuff out - things like custom XMP fields and writing directly into raw files, if you really really want. 

My thought is to have a single menu command that launches a dialog. Enter the date and time, click OK, and Exiftool does the rest. It works on TIF. PSD, JPEG and DNG (I recently scanned in some pictures through my camera).

To use it without overwriting any existing LR metadata you'd start with a Ctrl/Cmd S, run the plug-in, then finally do a Read Metadata.

John


----------



## Victoria Bampton (Jan 7, 2011)

Which plug-in writes directly to raw John?  I saw that in your PM and was interested, but I haven't had chance to catch up on your work properly for a while.

That sounds like a great plan anyway!

Edit - oh, one other potential idea - is there a way to put an incremented time stamp (i.e. 12:00, 12:01, 12:02) - IMHO the time itself doesn't matter, but I'm just thinking it might help them always stay in the right order in any software?


----------



## Bruce J (Jan 7, 2011)

johnbeardy said:


> Quick because as you may have heard I have a plug-in that is much more complex and I just needed to chop stuff out - things like custom XMP fields and writing directly into raw files, if you really really want.
> 
> My thought is to have a single menu command that launches a dialog. Enter the date and time, click OK, and Exiftool does the rest. It works on TIF. PSD, JPEG and DNG (I recently scanned in some pictures through my camera).
> 
> ...


 
Sounds great to me John.  How hard would it be to add some of the other fields that I fill in the scan.txt file that I included above?  I'm particularly interested in being able to set the camera, ISO, etc. for all the images from an entire roll of film at one go.  Thanks,


----------



## johnbeardy (Jan 7, 2011)

Victoria Bampton said:


> Which plug-in writes directly to raw John?



It was originally for a client and has only been shown to one or two people that I work with.



Victoria Bampton said:


> Edit - oh, one other potential idea - is there a way to put an incremented time stamp (i.e. 12:00, 12:01, 12:02) - IMHO the time itself doesn't matter, but I'm just thinking it might help them always stay in the right order in any software?


 That might work. Not too hard to do either!

John


----------



## johnbeardy (Jan 7, 2011)

Bruce J said:


> Sounds great to me John.  How hard would it be to add some of the other fields that I fill in the scan.txt file that I included above?  I'm particularly interested in being able to set the camera, ISO, etc. for all the images from an entire roll of film at one go.  Thanks,



Not at all hard. One step at a time though!

John


----------



## johnbeardy (Jan 7, 2011)

Bruce, have you had success writing the time as in your example? I've got the date nailed down but the time is proving very resistant - just 00:00 .

John


----------



## Mark Sirota (Jan 7, 2011)

In addition to DateTimeOriginal, I'd like to be able to enter artist, copyright, caption.  I'm fine with assuming that all selected photos should get the same data, and it could just be user-entered text rather than preset data or copied from some other location (though that could be fancy too).  Relevant EXIF fields:

Artist
Copyright
ImageDescription

For user-entered data, be aware that EXIF strings are ASCII only.  If you're using exiftool to write perhaps it'll handle this gracefully, but it's worth testing.  Of particular concerns are symbols like ©.

I would envision people wanting shooting data (make/model/lens/etc, exposure and such).  I'm less convinced of the value of this for scans, and lens data in particular is pretty ugly, so it's low on my wishlist.

Others have asked for the ability to write XMP-type data back to raw files.  This really sounds very similar, and could perhaps be implemented in the same plug-in.
Thanks!


----------



## johnbeardy (Jan 7, 2011)

I can definitely write to raw files, Mark, but sooner or later it would end in tears.


----------



## johnbeardy (Jan 7, 2011)

Ready for sacrificial victims - sorry, beta testers. It includes dates, and an optional incremented time stamp (seconds).

Now, one idea is to add a text box into which you could type* -Model=NIKON N80* for example. Providing it is as simple as that, I could parse it into *-Model="NIKON N80" *which Exiftool would require, or I could just let you type in the text and not parse it - in which case Bruce's longer string could be input. how bareback do you want this beast?

John


----------



## Mark Sirota (Jan 7, 2011)

johnbeardy said:


> Now, one idea is to add a text box into which you could type* -Model=NIKON N80* for example.


 
Initial reaction: I love that idea!  Super bare-bones.  Just give me a box where I can type arguments to exiftool, which will be applied to all selected photos.

On second thought: it's not enough -- I need to be able to see what's there first and check my results afterward.  I need to see exiftool's response.  Possible?


----------



## johnbeardy (Jan 7, 2011)

Sounds like you're also fed up of the nanny state, Mark. 

Exiftool's response - not easy without significantly more code (which is in that other plug-in). Sadly the SDK only reports whether the call to the other program was a success or not, so I would need to send second command line to Exiftool and make it output the file's metadata as a text file, and then parse that file back into a dialog box in LR. Can be done though.

I've been checking my results by jumping over to Bridge, or by doing a Read Metadata. The other way is through a log file which outputs the command line. It's dead easy to edit it, whack on the -k parameter and run Exiftool again in shell/terminal. Bare bones again!

John


----------



## johnbeardy (Jan 7, 2011)

As it looks now:


----------



## Brad Snyder (Jan 8, 2011)

It's so pretty, I kept clicking the OK button on the Screen Cap. duh!


----------



## johnbeardy (Jan 8, 2011)

Ha! I plan to release the plug-in later today with a couple more changes. You can now copy the command line and try it out in shell/terminal, and I intend to add a link to Exiftool's options documentation. The dialog box is "sticky" but somewhere down the line I can imagine adding presets - even if that's a bit fancy for the barebones concept.

John


----------



## Victoria Bampton (Jan 8, 2011)

Brilliant work John!


----------



## johnbeardy (Jan 8, 2011)

http://www.beardsworth.co.uk/toolbox/capturetimeexif/ - if anyone wants to try it.

John


----------



## Bruce J (Jan 8, 2011)

johnbeardy said:


> Bruce, have you had success writing the time as in your example? I've got the date nailed down but the time is proving very resistant - just 00:00 .
> 
> John


 
Sorry I didn't get back sooner.  Apparently, I'm not subscribed to threads that I post to.  I don't think I ever tried a time other than 00:00 as I only have dates for my scanned images.  But, it sounds like you've passed that hurdle by now.  If not, let me know and I'll try it here.  Looks great from your screenshot.  Are you still looking for someone to test it?  I'd be glad to help any way I can.  Thanks for taking this up,


----------



## johnbeardy (Jan 8, 2011)

Bruce, as you'll see in post 23, people can try it now. It's limited to 10 items at a time, and you should be able to enter that entire whole command line if you want.


----------



## orleyd (Jan 1, 2011)

My desired outcome is to change the DTO on scanned image files (large tif master files) to match the time the photos were taken.  I'm familiar with the change capture time feature which works fine for one image but when selecting a batch to re-date, it does a relative time offset against the DTO.

After trying A Better Finder, which seem to work fine to batch reset the Date Created in Finder, but doesn't  alter the DTO when I read the file in LR or CS5 Bridge.  Exiftools seems to be beyond my skill set.  I'm not opposed to using another software tool to get the dates right if it is user friendly for someone who isn't into Terminal and machine code.

I had hoped to select a number of images from the same historical event such as Christmas 1992, put them in a collection, manually sort them in order of occurrence and then batch reset the time to allow sorting by capture time to put them in order for printing.

I'm using LR 3.3, Mac Pro.


----------



## johnbeardy (Jan 9, 2011)

To apply Bruce's string of parameters, copy this into the Arguments box:

-Make="NIKON CORPORATION" -Model="NIKON N80" -FocalLength=55 -FocalLengthIn35mmformat=55 -LensMake="Micro-Nikkor" -LensModel="55mm f/2.8" -MaxApertureValue=2.8 -Lens="Micro-Nikkor 55mm f/2.8" -LensInfo="55 55 2.8 2.8" -ExposureTime="1/500" -FNumber=5.6 -ISO=100


----------



## Bruce J (Jan 9, 2011)

Thanks John, the latest version seem to be working perfectly.  I made an additional discovery this morning.  If you want to remove a field entirely, you can do it by including the field name in the arguments string w/ no value after the '='.  For example, I used the string from your last message (from my original batch file) to add metadata to a series of images to check the time incrementing function.  That worked perfectly.  Then, I decided that some of the images were taken w/ a different lens, so I ran the plug-in again and just removed the values from the arguments that referred to the lens.  That resulted in the removal of those tags from the metadata, just what I was hoping would happen.  Of course, I had to set the time to the correct second to keep from messing up the time sequence.  And, that wouldn't have worked correctly if the images had not been sequential.  Which brings me to my first suggestion (see next post) . . .


----------



## Bruce J (Jan 9, 2011)

Here are a couple initial suggestions for improving the user interface based on my initial use (and my own workflow!):

1.  Make the arguments box a bit bigger.  Would save a bunch of scrolling around if I could see the entire argument at once.  I realize someone will always come along w/ a larger argument, but I think it could go a bit bigger w/o harming anything.

2.  Make a way to turn off the date/time update.  This would make the plug-in of much more general use.  I'm thinking of a checkbox in front of both the date/time row and the arguments box.  Check to make those changes; uncheck to ignore.  Being able to do that, along w/ the sticky contents would allow a lot of flexibility for the type of operation I tried in the preceding post.

I think those two changes would be a good addition to the basic tool, w/o making a major challenge out of it.  Now, on to dreamland.  What I'd really like to see if I could have my 'druthers:

1.  Revamp the interface to look something like the LR sync interface; a series of EXIF tag names, each w/ a check box to turn it on or off and a text box for the value.  Include the date & time in the list so that they could be updated or not also.  Could even group some of them such as Make & Model, all the lens tags, etc.

2.  Automate the write metadata, update metadata, read metadata cycle.  I have the worst time remembering to save the metadata before running the plug-in.

3.  Presets.  Would be the frosting on the cake.

Don't misunderstand me please.  I love what you've built and I'm very grateful to you for making the effort to build the tool.  :hail: Thus, I hoped to present my ideas as thoughts for the future, not as criticism of the current work.  As always, I'd be delighted to help in any way that I can. :bluegrin:  Thanks again,


----------



## johnbeardy (Jan 9, 2011)

Hm, well perhaps I should show you how the dialog box already looks....



So I guess that deals with your first points 1 and 2, Bruce, and point 3 in the second group!

As for the other ideas, the SDK doesn't allow you to touch the save and read metadata commands - it is sorely needed. The other point about adding a series of specific tags is probably further down the track. Partly I wonder if there is demand for it, but also I don't feel I want to make it so easy that it'll appeal to people who should be kept away from such things for their own good! 

John


----------



## Bruce J (Jan 9, 2011)

johnbeardy said:


> As for the other ideas, the SDK doesn't allow you to touch the save and read metadata commands - it is sorely needed. The other point about adding a series of specific tags is probably further down the track. Partly I wonder if there is demand for it, but also I don't feel I want to make it so easy that it'll appeal to people who should be kept away from such things for their own good!
> 
> John



Fair enough.  You've certainly captured the most important features for me.  Is this one available to play with?  Cheers,

Bruce


----------



## Victoria Bampton (Jan 9, 2011)

John, you are officially brilliant!


----------



## johnbeardy (Jan 9, 2011)

Ah, thank you :blush:

I'll post the updated plug-in tomorrow - the preset code is new and needs a little work.

John


----------



## johnbeardy (Jan 10, 2011)

OK, it's now available via http://www.beardsworth.co.uk/new-lightroom-plug-in-capturetime-to-exif/ . The preset mechanism is still a bit clunky, but I think the rest works correctly.

John


----------



## MDomino (Feb 14, 2012)

Hi John!

I just tried and bought your plug-in and it's working well for me!
However, I have a feature suggestion, which I think would improve the plug-in quite a bit. Now, since I am not a coder of any sort, I am not sure if it is even possible to implement such a feature or if you are willing to change this plug-in at all, but I thought I make the suggestion anyways, maybe you like the idea.

I have a huge amount of scanned photos here and want to set dates for each photo as well as possible, although of course I don't know most of the dates of my photos.

But sometimes, if you have a film roll scanned you know at least the dates of a few pictures and this is where my feature suggestion comes in: It would be great if I could select a row of pictures, set the date of the first and of the last of those pictures and then the plug-in would interpolate the dates of all the pictures in-between. Then they are at least somewhat in the right place, much more than they would be with the +1 second time stamp.

A real world example: I have a roll of film scanned, the first picture is from my birthday, which I know is in July, the last picture is from Christmas and I don't really know the dates of pictures in between. I could now use the plug-in to set my first picture's date to July and the last to Christmas and all the pictures in between would get dates that are spread equally between these two dates.

Additionally this then could be improved even more by adding a "avoiding night times" feature. Example: I have a roll of film of a camping weekend, so I could use the interpolation feature to set the first photo to friday evening and the last to sunday afternoon. But that will probably also give some pictures some weird nighttime and I can visually see right away that all the pictures were taken by daylight. Now with a "avoid night time" feature I could maybe define certain hours (like 10pm to 8am) where I am certain that no picture was taken. Then in the interpolation the plugin will avoid these times and spread the pictures over the remaining times accordingly.

Hope this idea doesn't sound to crazy. I think this would be a great addition to this plug-in and be very useful for people that have many scanned images. I, for one would find it incredibly helpful (and I have been looking for a tool that does what I just described, but no luck).

Thanks a lot for reading! Would be great to hear what you think of it, even if you don't like it.

Regards,
MD


----------



## johnbeardy (Feb 14, 2012)

OK, MD, I've noted the request. It could be done, or at least the interpolation could be. The avoiding strikes me as being so custom that I can't see myself looking in that direction though!

John


----------



## MDomino (Feb 14, 2012)

Hi John!
Wow, thanks for the quick response!
Actually, the "avoiding feature" is not really that important for me. The interpolation thing would be a fantastic addition, though.
And as I said, I have been looking everywhere for something like this (plug-ins or standalone) and I couldn't find anything.

When you say "it could be done", does that mean you would possibly try to implement such a feature in a future version of the plug-in? I am not familiar with how you update your plug-ins, since I have only discovered them recently.

Thanks again!

MD


----------

