ExifTool completely breaks when doing a full metadata rewrite from stdin

Started by Bilge, April 19, 2013, 07:30:23 AM

Previous topic - Next topic

Bilge

The following command will destroy the image data retaining just the metadata.

exiftool - -all= -tagsfromfile @ -all:all -unsafe <in.jpg >out.jpg

I use exiftool exclusively with piped data so this is a big problem for me. Can this be fixed, Phil?

Phil Harvey

You're right, that won't work.  Interesting though.  I'll have to think about this...

- 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 ($).

Bilge

This is the last piece to a puzzle I have worked on for over a year. I'm counting on you, Phil!  :)

Phil Harvey

It was actually a bit tricky since I had to buffer the input in memory because this command reads the file twice, but I have something that seems to work now, but it needs more testing.

If you can run the Perl version, you can help with testing.  I have uploaded a pre-release here.

- 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 ($).

Bilge

There was ever a non-Perl version? This version seems to be working for me  :)

Phil Harvey

Great, let me know if you have any problems.

The non-Perl version would be the Windows executable (which is really just a bundled Perl version).

- 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 ($).

Phil Harvey

I have officially released version 9.28 now.  There are substantial changes since the pre-release because I discovered some problems when combined with other options.  There may still be some lingering problems if people try to do some obscure things (like using the -fileOrder option with stdin as the input, which doesn't make sense of course), but at least it should be better now than it was.

- 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 ($).

Bilge

OK Phil I will upgrade to the official release for production use! Do you anticipate any other issues when using the command outlined in the OP that I should look out for?

Phil Harvey

The original command you gave is quite simple (no extraneous options that may compete for the stdin/stdout streams), so it should be perfectly fine.  The only potential issue is that this technique requires the entire file to be buffered in memory, so you need enough available memory to cover this.

- 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 ($).