ExifTool Forum

ExifTool => Developers => Topic started by: maxmax on April 15, 2011, 09:55:22 AM

Title: piping from standard output to writer
Post by: maxmax on April 15, 2011, 09:55:22 AM
I have been integrating the exiftool in an external program and using the piping example for reading.
wonder if the piping can be done for the writing too? or is there any otherway to do this?
exact case:
I want to write the data from a xml standard output as following
my.xml : extracted metadata from any other file
dst.jpg : the  binary where metadata is written

example writing  in docu : exiftool -tagsFromFile  my.xml  dst.jpg
Intented writing:  cat my.xml | exiftool dst.jpg -all= -tagsFromFile -

Title: Re: piping from standard output to writer
Post by: Phil Harvey on April 15, 2011, 11:43:16 AM
The problem with piping is that you only have one input pipe and one output pipe so complicated write operations like those using -tagsfromfile can not be done this way without the use of temporary files.

But if there is only one input and one output file, then you can use pipes.

- Phil
Title: Re: piping from standard output to writer
Post by: maxmax on April 18, 2011, 07:34:26 AM
actually i want to use one  input file  and one output file.
the procedure is that, i want to delete all the metadata from a file and inject it from another file.
Title: Re: piping from standard output to writer
Post by: Phil Harvey on April 18, 2011, 08:39:31 AM
Remove all metadata in a pipe:

cat src.jpg | exiftool -all= - > dst.jpg

- phil