ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: mujer_esponja on October 01, 2010, 11:35:32 AM

Title: Problems with -o option
Post by: mujer_esponja on October 01, 2010, 11:35:32 AM
Hello, I am using this command:

exiftool -a -u -g1 -j -k -r -w .json inputDir

And I want to have all the results in my outputDir, but I can`t manage to get it!!
Any help?

Thanks in advance!
Title: Re: Problems with -o option
Post by: Phil Harvey on October 01, 2010, 01:19:52 PM
I think something like -w OUTDIR/%f.json may do what you want.

The -o option is NOT what you want.  It is the output directory when WRITING the image.

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 04, 2010, 04:11:36 AM
Thank you very much!!!
I am working with Mac now, I tried also with Win and works perfectly also, but is not going to be a 'problem' this %f in Linux???

Anyway, thanks, you helped me!
Title: Re: Problems with -o option
Post by: Phil Harvey on October 04, 2010, 07:39:02 AM
Percent characters in command-line arguments should not be a problem in Linux.  But if you want to be safe you can always put quotes around the argument.

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 05, 2010, 04:49:20 AM
Hello Phil, thanks indeed for your answers.
Actually I am not having problems executing this command in the terminal, nor in Mac, Win or Linux, but I am programming in Java and executing this command from a project, it is no generating any file even checking paths or any other thing. My piece of code is:

String process = "exiftool -a -u -g1 -j -k -r -w "+ outDir +"%f.json " + inDir;

Do you know why?
Thanks in advance
Title: Re: Problems with -o option
Post by: Phil Harvey on October 05, 2010, 07:21:03 AM
I don't know Java, but you definitely need to add quotes around "outDir" in the command line in case it contains spaces or other special characters.  Also, you need a space in front of "%f.json" or it will become part of "outDir".

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 06, 2010, 06:27:15 AM
Thanks Phil, my solution was executing a Script from my project, because I think there is no other solution.
Anyway, my output files, are (the ones which are not the first one in my inDir) in this way:

[,
{
  "SourceFile": "pepe/AnimalsPlayingSoccer.flv",
  "ExifToolVersion": 8.32,
   (....)
}]


I tryed with several options to try to avoid this first ',' character, guessing this is not another tag, so -x option doesn't do what I want to. Am I right??
Is there any solution? I saw tha with xml files, I don't get this ',' but I have a lot work using JSon files and I wouldn't want to change everything to this xml.

Thanks again.
Title: Re: Problems with -o option
Post by: Phil Harvey on October 06, 2010, 07:15:48 AM
I tried many things but can't get this comma in the output.  What is the exact command you are using?

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 06, 2010, 07:26:26 AM
exiftool -a -u -g1 -j -k -r -w outDir/%f.json inDir

If in inDir there are many files to extract metadata from, I get one JSon file for each one, but from the second until the last one, start whith this coma.
Because if -w option doesn't appear, I get just one file with all metadata information in this folder from all files in it, separated by comas, so spliting this file I get exaclty these comas.
Sorry for my English!! I know is terrible :)

Thanks Phil!
Title: Re: Problems with -o option
Post by: Phil Harvey on October 06, 2010, 08:51:26 AM
Thanks.  I'm getting the comma now.  I'll let you know when I've figured out what is causing this.

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 06, 2010, 09:00:53 AM
Thank you so much Phil!
Title: Re: Problems with -o option
Post by: Phil Harvey on October 06, 2010, 10:43:32 AM
I have found the problem, and it will be fixed in the next release (version 8.34).

Thanks for pointing this out.

- Phil
Title: Re: Problems with -o option
Post by: mujer_esponja on October 07, 2010, 03:16:12 AM
Thank you too Phil!