piping from standard output to writer

Started by maxmax, April 15, 2011, 09:55:22 AM

Previous topic - Next topic

maxmax

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 -


Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

maxmax

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.

Phil Harvey

Remove all metadata in a pipe:

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

- phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).