won't read from standard input in some cases

Started by simonndhearn, April 27, 2016, 11:00:45 PM

Previous topic - Next topic

simonndhearn

version: windows 10.15

this works...

  compress -quality 60 in.jpg | exiftool -thumbnailimage= - -o - > out.jpg

this fails...

  compress -quality 60 in.jpg | exiftool -thumbnailimage= - -o out.jpg

with: Error: Can't create JPEG files from scratch

It seems like it only reads from the standard input well if it is also writing to the standard output.

Is this a bug or is it me?

Phil Harvey

#1
The problem is that ExifTool doesn't know the type of file until it starts reading it when '-' is specified for the input file.  But the logic for the command is very different if the files are different formats (ie. a JPEG input file and an XMP output file).

I suppose that I could assume the output format is the same, and issue an error later if that assumption was incorrect.  This would allow you to do what you want.  Look for this change in version 10.16

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

simonndhearn

Ok Thanks. It made my powershell script a little more complicated that's all. I'll check out the next version.