Mass Copy Maker Notes from Raw to Jpg if not available in Jpg

Started by Archive, May 12, 2010, 08:54:40 AM

Previous topic - Next topic

Archive

[Originally posted by webengel on 2009-10-02 15:45:22-07]

Hi,

I would like to copy maker notes from the raw file to the jpg but only if the jpg does not have it already.

This should be done for all files in a folder.

I have tried the following command without success:
c:exiftool -TagsFromFile %d%f.ARW -makernotes -make -model -r -ext JPG dir -if "not $LensId"

All parts of that command have worked, but the combination of wildcards and -if statement doesn't seem to.  Wrong order?

Any hints?

Thanks,
Martin

Archive

[Originally posted by exiftool on 2009-10-02 16:07:33-07]

Hi Martin,

Looks good and works for me here (after I changed your double
quotes to single quotes since I'm not on Windows).
Just to be safe, first make sure you are using a reasonably
up-to-date version of exiftool (ie. 7.60 or later).
Then, perhaps try adding -v2 to the command to
see if it gives any more information about what is happening.
If it still doesn't work, paste the -v2 command output
inside a
Code:
block here so I can see
what happened.

Also, if the command is in a batch file you will need to double
up all the '%' characters.

- Phil

Archive

[Originally posted by webengel on 2009-10-02 17:51:17-07]

Phil,

V7.79 and no batch file, simple command window.

The original command I used had simply no output and did not change any file.  Same if I add the switch -v2 (or v5 or whatever) at the end of the command line or at the beginning.

c:exiftool -v2 -TagsFromFile %f.ARW -makernotes -make -model -r -ext JPG dir -if "not $LensId"

The directory has just two files:

2009-08-22  17:12        25 168 896 20090822-171237-055.ARW

2009-08-30  20:58         2 523 258 20090822-171237-055.JPG

Martin

Archive

[Originally posted by exiftool on 2009-10-02 18:02:54-07]

Hi Martin,

This is a bit of a mystery.

Can you paste the full console trascript you get when
running the following commands (with 'DIR' changed
to your directory name):

Code:
dir DIR
 c:exiftool -ver
 c:exiftool -filename DIR
 c:exiftool -ext jpg -filename -if "not $lensid" DIR
 c:exiftool -ext jpg -tagsfromfile %d%f.arw -makernotes -make -model -v2 DIR
 c:exiftool -ext jpg -tagsfromfile %d%f.arw -makernotes -make -model -v2 -if "not $lensid" DIR

- Phil

Archive

[Originally posted by exiftool on 2009-10-02 18:28:26-07]

I just fired up the PC (Windows XP serice pack 2) and tried this exact
command and it worked fine for me:

Code:
exiftool -v2 -TagsFromFile %d%f.ARW -makernotes -make -model -r -ext JPG tmp -if "not $LensId"

Where "exiftool.exe" and "tmp" are in the current directory,
and the "tmp" directory contains 2 files: "a.jpg" and "a.arw".

And as expected, it failed with "1 files failed condition" the
second time I ran the command (since the LensId then existed).

- Phil

Archive

[Originally posted by webengel on 2009-10-02 18:28:46-07]

Phil,

that was it!  Just wrong order or missing the directory.  The command that now works is

c:exiftool -ext jpg -tagsfromfile %d%f.arw -makernotes -make -model -if "not $lensid" .

(including the last period).  Thanks.

I'll put the lengthy console output in a different post though you may not need it anymore.

Martin

Archive

[Originally posted by webengel on 2009-10-02 18:30:50-07]

Code:
D:\Fotoalbum\Test_technisch\ExifTool>dir D:\Fotoalbum\Test_technisch\ExifTool
 Volume in drive D is D_Data
 Volume Serial Number is 6AC1-0014

 Directory of D:\Fotoalbum\Test_technisch\ExifTool

2009-10-02  20:21    <DIR>          .
2009-10-02  20:21    <DIR>          ..
2009-08-22  17:12        25 168 896 20090822-171237-055.ARW
2009-08-30  20:58         2 523 258 20090822-171237-055.JPG
               2 File(s)     27 692 154 bytes
               2 Dir(s)  20 665 192 448 bytes free

D:\Fotoalbum\Test_technisch\ExifTool>c:exiftool -ver
7.79

D:\Fotoalbum\Test_technisch\ExifTool>c:exiftool -filename D:\Fotoalbum\Test_tech
nisch\ExifTool
======== D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.ARW
File Name                       : 20090822-171237-055.ARW
======== D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.JPG
File Name                       : 20090822-171237-055.JPG
    1 directories scanned
    2 image files read

D:\Fotoalbum\Test_technisch\ExifTool>c:exiftool -ext jpg -filename -if "not $len
sid" D:\Fotoalbum\Test_technisch\ExifTool
======== D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.JPG
File Name                       : 20090822-171237-055.JPG
    1 directories scanned
    1 image files read

D:\Fotoalbum\Test_technisch\ExifTool>c:exiftool -ext jpg -tagsfromfile %d%f.arw
-makernotes -make -model -v2 D:\Fotoalbum\Test_technisch\ExifTool
======== D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.JPG
Setting new values from D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055
.arw
Writing ExifIFD:MakerNoteSony4 if tag exists
Writing ExifIFD:MakerNoteSony4
Writing PNG:Make
Writing MIE-Camera:Make
Writing CanonRaw:Make if tag exists
Writing XMP-tiff:Make if tag exists
Writing IFD0:Make
Writing IFD0:Make
Writing PNG:Make
Writing MIE-Camera:Make
Writing CanonRaw:Make if tag exists
Writing XMP-tiff:Make if tag exists
Writing IFD0:Make
Writing IFD0:Make
Writing PNG:Model
Writing MIE-Camera:Model
Writing CanonRaw:Model if tag exists
Writing XMP-tiff:Model if tag exists
Writing IFD0:Model
Writing IFD0:Model
Writing PNG:Model
Writing MIE-Camera:Model
Writing CanonRaw:Model if tag exists
Writing XMP-tiff:Model if tag exists
Writing IFD0:Model
Writing IFD0:Model
Rewriting D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.JPG...
  Editing tags in: APP0 APP1 CIFF ExifIFD IFD0 JFIF MIE-Camera MakerNotes PNG XM
P
  Creating tags in: APP1 ExifIFD IFD0 MIE-Camera PNG
JPEG APP1 (12190 bytes):
  Rewriting IFD0
  ExifByteOrder = II
    - IFD0:Make = 'SONY'
    + IFD0:Make = 'SONY'
    - IFD0:Model = 'DSLR-A900'
    + IFD0:Model = 'DSLR-A900'
  Rewriting ExifIFD
    + ExifIFD:MakerNoteSony4 = '!..f......x. ..Jx*.........Du...........l.Lu....
p.....[snip]'
  Rewriting GPS
  Rewriting IFD1
JPEG APP13 (11674 bytes):
JPEG APP2 (3158 bytes):
JPEG APP1 (14789 bytes):
  Rewriting XMP
    - XMP-tiff:Make = 'SONY'
    + XMP-tiff:Make = 'SONY'
    - XMP-tiff:Model = 'DSLR-A900'
    + XMP-tiff:Model = 'DSLR-A900'
JPEG APP14 (12 bytes):
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG DRI (2 bytes):
JPEG DHT (416 bytes):
JPEG SOS
    1 directories scanned
    1 image files updated

D:\Fotoalbum\Test_technisch\ExifTool>c:exiftool -ext jpg -tagsfromfile %d%f.arw
-makernotes -make -model -v2 -if "not $lensid" D:\Fotoalbum\Test_technisch\ExifT
ool
-------- D:/Fotoalbum/Test_technisch/ExifTool/20090822-171237-055.JPG (failed co
ndition)
    1 directories scanned
    1 files failed condition
    0 image files read

Archive

[Originally posted by exiftool on 2009-10-02 18:43:05-07]

Great.  Glad that it works now.  The order of most options
doesn't matter.  The only thing that does is that -makernotes
-make and -model must come after -tagsfromfile.  Other than
that, any order is OK.  So the problem must have been the
missing directory.

- Phil

Archive

[Originally posted by exiftool on 2009-10-02 18:44:15-07]

(although I still don't understand this fully, because you should
get the message "No file specified" if you forget the directory
name.)

Archive

[Originally posted by exiftool on 2009-10-02 18:55:28-07]

Ah!  Now I see.  If you enter a directory name that doesn't exist
then exiftool fails silently.  The reason is because the name is taken
as a file name if a directory isn't found, but you've already told it
to only process files with a "JPG" extension, so nothing is done.
However, it would be better if you got some sort of message
in this case.  will look into this.

- Phil