Importing DM-9 / DS-100 data into scans |
Page 123 8> |
Author | |
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() Posted: 03 March 2008 at 19:28 |
Does anyone know of a good utility for batch copying data from the DM-9 or DS-100 into scans?
|
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
Okay, so I'm a masochist, attempting to write a batch file (Windows XP version .cmd file) to read the DNO-####.txt file from my DM-9, and then command exiftool to make the edits with the data provided.
I have some programming experience from back in school, but I've never written a batch file before. Don't criticize my choice of language to write this in, as bad as a choice I will admit it was. However, it seems nobody else has made an attempt at this, and once I get this written the first time, I'm sure anyone with knowledge of another scripting language can write their own with mine as a base (since all the logic will be laid out). Is there anyone with experience with either batch files or the intricacies of exiftool from the command line who can help me on this? Specifically, I need some help in the custom tags department. Once this works, making a version for the DS-100 may be possible. |
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
polyglot ![]() Senior Member ![]() Joined: 25 June 2007 Country: Australia Location: Australia Status: Offline Posts: 3622 |
![]() ![]() ![]() ![]() |
Sounds like fun, and it should be eminently doable in Perl.
If you post a few examples of the DNO-*.txt files then someone here (maybe me if I get time, maybe someone else) could write a little script to do it. cmd.exe scripting seems like a recipe for pain and humiliation to me. |
|
![]() |
|
Bob J ![]() Admin Group ![]() Dyxum Administrator Joined: 23 December 2005 Country: United Kingdom Location: London Status: Offline Posts: 27352 |
![]() ![]() ![]() ![]() |
I used to do lots of command file programming in the old days (mainly on VAX/VMS and DOS)- not familiar with .cmd files, but if you can post some code and detail what you are trying to do, some of the old grey cells might start working again... :-)
|
|
RBJ ~ Moderation on Dyxum
|
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
the .cmd is just the NT/XP version of a .bat file. Fortunately, some of the commands are more usable.
The motivation in using a .bat file is that the user (xp user) can readily execute the program without having to install a scripting engine, and while not necessarily knowing how to code could still manage to edit the file in notepad if they desire/need to. Between my DM-9 and some other folks sending me output from a DS-100, it appears the code is functionally the same (if a little smaller on the DS-100 due to less data being available. Better yet, the same program could do both, and identify the right one from the contents of the DNO file. Link to the DM-9 Manual: http://www.vikenk.com/minolta_manual.htm ------------------------------------------ You will also need the windows version of exiftool in the same directory, as well as the DNO file, and the jpeg's, filenames consisting of numbers only plus the .jpg suffix. Also, I guess my idea of using batch code was driven since exiftool is a command line tool anyway. First, some pseudocode: ------------------------------------------ Get filename for the Minolta DNO file. Check that file exists, throw error if it doesn't exist. Get filename for the first scanned jpeg file. Assume all scanned jpegs from the roll of film are numbered sequentially upward from that. Open DNO-####.txt file, read the data, translate to exiftool input values: From the DM-9, the first line is dno-####. From the DS-100, the first line is dno-####,ISO:### Where obviously in both cases #### is some numerical value. So figuring out which type of file we're dealing with should be trivial. Bonus on the DS-100 is we have a global variable for the ISO. The second line are the Column headers. For the DM-9: Frame Shutter FNo. Lens +/- PASM Meter AF Area AFP/RP Drive Flash FL+/- FLMeter ISO Up No. Fix No. yy/mm/dd Time Written in English for the DM-9: Frame Number, Shutter Speed, Aperture, Focal Length/Max Aperture, Exposure Compensation Value, Exposure Mode (PASM), Metering Mode, Focus Mode, Focus Frame, Focus Priority, Drive Mode, Flash Mode, Flash Compensation Value, Flash Metering Mode, ISO, Count-up number, Fixed Number, Date (YY/MM/DD), Time For the DS-100: Frame Shutter FNo. Lens +/- PASM Meter FL +/- yy/mm/dd Time Under the lens column it's actually ####/## for focal length/max aperture. Ignoring the slashes used on this line for teh +/-, the delimeters used in all subsequent lines are forward slashes "/", tabs, and spaces. Loop starts Read the (first/next) line, set the variables accordingly, translate as necessary and sent into exftool: exiftool imageFileNo.jpg -Make="Minolta" -Model="Maxxum 9" -ShutterSpeedValue=shutterValue -ApertureValue=aperture -FocalLength=focalLength -MaxApertureValue="maxApertureValue -ExposureCompensation=exposureComp -ExposureProgram="Aperture-priority AE" -MeteringMode="Spot" -ISO="!ISO!" -DateTimeOriginal="2008:02:01 20:30:00" -CreateDate="2008:02:01 20:30:00" -FileSource="Film Scanner" maybe we want to re-read the data as spit back from exiftool: exiftool -k imageFileNo.jpg increase the filenumber counter, check if that file exists (if it doesn't assume end of roll, or check using eof of the DNO file). end loop -------------------------------------- That's the program in a nutshell. Things that make this terribly tricky: 1. Translating http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html For example, shutter: 30 -> 1/30, 30" -> 30, 0.5" -> 0.5? What do we do about BULB? Exposure Mode (PASM): M -> "Manual", P -> "Program AE", A -> Aperture-priority AE, S -> Shutter speed priority AE May need to modify the format of the timestamp. 2. User defined tags to supplement stuff not part of the exif specification that we want exiftool insert for us: http://www.sno.phy.queensu.ca/~phil/exiftool/faq.html#Q11 I am having trouble understanding this part. ------------------------------ Anyway, if anyone is interested in the masochism that is batch code, here is what I've put together so far. It's not complete, some lines are commented out that shouldn't be (debugging purpose), some lines should not be there outright, and others are gibberishy comments for me: Save as a .cmd file: @echo off SETLOCAL ENABLEDELAYEDEXPANSION rem SET /P dbFile=Enter Minolta DNO filename: rem if not exist %dbFile% echo no db file exists rem if not exist %dbFile% goto :end SET /P imageFile=Enter first jpeg file in sequence: if not exist %imageFile%.jpg goto :eof set /a imageFileNo=%imageFile% pause for /f "skip=2 tokens=1-23* delims=/ " %%A IN (DNO-0001.TXT) DO ( set frame=%%A set frame set shutter=%%B rem check for double quotes character in shutter value rem if present, remove it (shutter slower or equal to 0.5 sec) rem if not present appent 1/ to the front set shutter set aperture=%%C rem need to decide case where value is -- (null) and what to do about it set aperture set focalLength=%%D rem need to decide case where value is ---- (null) and what to do about it set focalLength set maxAperture=%%E rem need to decide case where value is -- (null) and what to do about it set maxAperture set exposureComp=%%F set exposureComp set exposureProg=%%G rem if P A S M etc set exposureProg set meteringMode=%%H rem cases set meteringMode set focusMode=%%I rem cases set focusMode set focusFrame=%%J rem cases set focusFrame set focusPriority=%%K rem cases set focusPriority set driveMode=%%L rem cases set driveMode set flashMode=%%M rem cases set flashMode set flashComp=%%N rem cases set flashComp set flashMeteringMode=%%O rem cases set flashMeteringMode set ISO=%%P set ISO set CountUpNo=%%Q set CountUpNo set FixedNo=%%R set FixedNo set Year=%%S set Year set Month=%%T set Month set Day=%%U set Day set Time=%%V set Time @echo on exiftool !imageFileNo!.jpg -Make="Minolta" -Model="Maxxum 9" -ShutterSpeedValue="1/50" -ApertureValue="!aperture!" -FocalLength="!focalLength!" -MaxApertureValue="! maxAperture!" -ExposureCompensation="0" -ExposureProgram="Aperture-priority AE" -MeteringMode="Spot" -ISO="!ISO!" -DateTimeOriginal="2008:02:01 20:30:00" - CreateDate="2008:02:01 20:30:00" -FileSource="Film Scanner" exiftool -k !imageFileNo!.jpg @echo off pause set /a imageFileNo += 1 echo imageFileNo=!imageFileNo! if not exist %imageFile%.jpg goto :end ) :end pause rem Frame Number, Shutter Speed, Aperture, Focal Length/Max Aperture, Exposure Compensation Value, Exposure Mode (PASM), Metering Mode, Focus Mode, Focus Frame, Focus Priority, Drive Mode, Flash Mode, Flash Compensation Value, Flash Metering Mode, ISO, Count-up number, Fixed Number, Date (YY/MM/DD), Time rem Shutter Speed - Append 1/## <-- what if T>1 second? rem Exposure Program: M="Manual"; P="Program AE"; A="Aperture-priority AE"; S="Shutter speed priority AE" rem Metering Mode: Multi="Multi-segment"; Ave="Average"; Spot="Spot" rem S="Single-shot AF"; C="Continuous AF"; A="Automatic AF"; M="Manual" rem -xmp:FocusMode="Single-shot AF" <-- needs to be user defined tag rem focus frame needs to be user defined tag rem focus priority needs to be user defined tag rem drivemode needs to be user defined tag rem Flash Mode needs to be user defined tag (and stripped down exif one) rem flash compensation value rem flash exposure compensation rem Flash Metering Mode needs to be worked on rem FilmType (eg reala) user input needs to be user defined tag Edited by hotwire - 08 March 2008 at 04:09 |
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
polyglot ![]() Senior Member ![]() Joined: 25 June 2007 Country: Australia Location: Australia Status: Offline Posts: 3622 |
![]() ![]() ![]() ![]() |
OK, I had a bash at it and have produced dm9toexif.pl; it's free software (GPL). You'll need to download the txt file and rename it to .pl. You'll need Perl installed, including the ExifTool package.
You need jpegs named *-upno.jpg in the same directory where upno is the 4-digit frame number that appears in the DNO-file. You run it like this: ./dm9toexif.pl dno*.txt and it will produce new jpegs named *-upno-exif.jpg and also *-upno.xmp files. I've only tested it on a hand-written DNO-file, so it could be wrong. People with a DM-9, please test it! Edited by polyglot - 08 March 2008 at 07:47 |
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
Thanks for writing that, but unfortunately, it leads me into the aforementioned problem of understanding how to install everything to get it to work.
|
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
polyglot ![]() Senior Member ![]() Joined: 25 June 2007 Country: Australia Location: Australia Status: Offline Posts: 3622 |
![]() ![]() ![]() ![]() |
Go to cygwin.com and download the little installer thing. Run it, select a mirror, tell it you want to install Perl and let it do its stuff.
That gives you a brand-new shell (command line prompt) called bash, which is much, much more powerful than cmd. Google bash for instructions on how to use it. Useful commands are: ls = directory listing, ls -l for details rm = delete files cd = change directory cp = copy files mv = move files mkdir/rmdir = create/remove directory If you press tab, it will attempt to complete a filename; pressing tab again shows you the possible completions if ambiguous. Download Image-ExifTool-7.20.tar.gz (say to c:\download) and untar it using the cygwin bash shell: cd /cygdrive/c/download tar -xzf Image-ExifTool-7.20.tar.gz In there you'll find a lib directory, containing the perl modules; copy them to your vendor_perl directory: cd Image-ExifTool-7.20/lib cp -r * /usr/lib/perl5/vendor_perl/5.8/ Download the dm9toexif script as a text file to c:\download or something, then make it executable and run it: cd /cygdrive/c/download mv dm9toexif.txt dm9toexif.pl chmod +x dm9toexif.pl ./dm9toexif.pl -h If you've got any more questions, feel free to ask. |
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
That is something I feared. My intent was to create something that most users can utilize with a minimum of effort. While I have limited experience with cygwin, my fear is that these steps will be too much for some-most other users.
I will attempt to put this all together now though. |
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
polyglot ![]() Senior Member ![]() Joined: 25 June 2007 Country: Australia Location: Australia Status: Offline Posts: 3622 |
![]() ![]() ![]() ![]() |
Alternatively if you're in linux (edit: and probably OSX too), it's a triviality. Every distribution comes with Perl and as soon as you install ExifTool, you get the modules. In that case, all you need to do is download my script and run it!
It's only hard because ExifTool doesn't include an installer for Windows. And besides, how many DM-9 users are technophobes? I mean, they bought a data back for a top of the range SLR. Edited by polyglot - 09 March 2008 at 03:12 |
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
I managed to come up with a slightly more friendly windows method.
download this Perl distribution (the free one): http://www.activestate.com/Products/activeperl/features.plex Install, then dl the Perl version of exiftool. Follow the instructions on the exiftool webpage: http://www.sno.phy.queensu.ca/~phil/exiftool/install.html but instead of putting in c:/windows, put in c:/Perl/lib So you should have: exiftool.pl, exiftool.pm, and exiftool.pod in the /lib directory, and well as the /file and /image directories in /lib. dm9toexif.pl should be in the directory with the images and the dno file, and is called by: dm9toexif.pl dno-0001.txt (or whatever number) from the command prompt. ---- Anyway, after successfully getting that far, I got the following: Processing DNO-0001.txt bad header in DNO-0001.txt polyglot, check your pm's. Edited by hotwire - 09 March 2008 at 17:44 |
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
polyglot ![]() Senior Member ![]() Joined: 25 June 2007 Country: Australia Location: Australia Status: Offline Posts: 3622 |
![]() ![]() ![]() ![]() |
Heh. Obviously my hand-constructed test file was wrong :)
PM'd my email. |
|
![]() |
|
hotwire ![]() Senior Member ![]() Joined: 28 August 2006 Country: Canada Location: Toronto Status: Offline Posts: 1053 |
![]() ![]() ![]() ![]() |
Sorry about not being able to email you back last night, polyglot. I went to bed, work up and am now at work.
Your latest version seems to run. However, I think a few things need to be changed. Instead of using upno, we should use frame instead. On a roll of film, it's a maximum of 36 exposures, whereas upno is a five digit integer (and I still don't quite understand the use of this column from the DM-9 manual), notwithstanding the fact there is no upno field for the DS-100. Also, do the image files have to end in -##, can the dash be excluded? We would have to check the default neg scanner output file names for various makes and models, but I know the neg scanner at my local costco (I know, shame on me...) outputs ########.jpg on the photo cd. Edited by hotwire - 10 March 2008 at 14:49 |
|
a99ii; Maxxum 9
CZ: 16-35, 24-70/2.8, 135/1.8; Minolta: 50/1.4; MC58/1.2; 85/1.4GD 300/2.8; 500/8; 600/4; Tam: 90/2.8M; Sig: 12-24/4.5-5.6; 15/2.8; Sony: 35/1.4G; 135STF, 70-200/2.8G |
|
![]() |
|
Elgsdyr ![]() Groupie ![]() Joined: 12 November 2005 Location: Denmark Status: Offline Posts: 79 |
![]() ![]() ![]() ![]() |
Interesting thread, I just discovered now. I did this long ago with a combination of EXIFUtil and a REXX script. Also did a bunch of other scripts to handle different tasks with the data files. Before I got the DS-100 for the 7, I also used a home-grown script to manually type in the data and save to a file using same format as the DS-100. A lot of work, but I couldn't afford the DS-100 at the time and I didn't want to lose the data...
After getting the DS-100 I did a sync-script for semi-automatically transferring the new data files from the smartcard. It was also able to work around a bug I discovered in the way the 7 copies its data to the DS-100. |
|
Yours etc.
Torsten Balle Koefoed |
|
![]() |
![]() |
Page 123 8> |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.081 seconds.

Dyxum.com - Home of the alpha system photographer
In memory of Cameron Hill - brettania
Feel free to contact us if needed.