ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Bilge on April 19, 2013, 07:30:23 AM

Title: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Bilge on April 19, 2013, 07:30:23 AM
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?
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Phil Harvey on April 19, 2013, 08:10:17 AM
You're right, that won't work.  Interesting though.  I'll have to think about this...

- Phil
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Bilge on April 19, 2013, 11:04:45 AM
This is the last piece to a puzzle I have worked on for over a year. I'm counting on you, Phil!  :)
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Phil Harvey on April 19, 2013, 11:11:04 AM
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 (https://exiftool.org/Image-ExifTool-9.28p.tar.gz).

- Phil
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Bilge on April 19, 2013, 11:22:14 AM
There was ever a non-Perl version? This version seems to be working for me  :)
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Phil Harvey on April 19, 2013, 11:24:10 AM
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
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Phil Harvey on April 21, 2013, 07:55:26 AM
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
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Bilge on April 21, 2013, 12:14:35 PM
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?
Title: Re: ExifTool completely breaks when doing a full metadata rewrite from stdin
Post by: Phil Harvey on April 21, 2013, 08:54:58 PM
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