-b option in "classic" vs -stay_open ExifTool usage

Started by BogdanH, January 11, 2012, 02:59:26 PM

Previous topic - Next topic

BogdanH

Hi Phil,
I have spend the whole evening to get following working, but I failed. Ok...
In standard cmd-line usage:
exiftool -b -PreviewImage -w zz.jpg 450D.CR2
-I get, as expected, nice 450Dzz.jpg file.

Now, I'm executing following command in -stay_open mode via (StdIn/StdOut):
-b
-PreviewImage
-w
zz.jpg
450D.CR2

-and get "0 output files created" (btw. all lines are separaded with CR/LF, of course).

I'm 99.99% sure, that my -stay_open code (piping, etc.) is working correctly. That is, similar commands, where -w is used (for writting metadata into mie files, etc.) is working flawless.

Any idea?

Bogdan

Phil Harvey

Hi Bogan,

Did you erase the 450Dzz.jpg file from the first command?

The -w option will not overwrite existing files.

But if this was the problem, you should have got a warning message in the stderr output.

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

BogdanH

Hi Phil,

No, it's not because resulting jpg file would allready exist. I am "converting" existing classic commands from "old" GUI into new GUI, where I'm trying to work in -stay_open mode where ever possible. Originally, above command is a bit more complex (writting into subfolder, etc.), but when I noticed it doesn't work, I've came to much shorter command (as shown above). I've also tried to write into non-existing subdir, i.e:
-b
-PreviewImage
-w
testing\zz.jpg
450D.CR2

-here, ExifTool creates "testing" subdir as it should, but I get the same "0 otput files created" message (and subdir is empty, of course).
Needless to say, that 450D.CR file actually exist in current directory -that is, it works in cmd-line mode.

Bogdan

Phil Harvey

Adding the directory to the -w option should be done like this:

-w
test/%f.jpg


What you have done with "testing\zz.jpg" will produce an output file called "450Dtesting\zz.jpg" (assuming that the backslash isn't eaten as an escape code by some intermediate software -- maybe safer to use forward slashes for this reason).

There are only 3 reasons why the output file wouldn't be created:

1) ExifTool can't find the input file (you would get a warning).

2) The output file already exists (you would get a warning).

3) The input file doesn't contain the PreviewImage tag (no warning).

You've ruled out number 2.  Could it be problem 1 (the default directory is different when you are running in -stay_open mode)?

I just verified here that it works for me here with -stay_open.

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

BogdanH

Hi Phil,

Weird.. I've tried:
-w
zz.jpg
450D.CR2

-and file gets created (content is wrong, of course).
Then (note: without -b):
-w
zz.jpg
-PreviewImage
450D.CR2

-and file is not created, but it should be (with wrong content) according to cmd-line usage. Because of this, I assume, the problem is here somewhere (not related to -b option).
Btw. I've also tried -JpgFromRaw (on NEF file) and again, jpg isn't created.

On the other hand, as I allready mentioned, I have no problem with, i.e.:
-w
xx.html
-htmlDump
450D.CR2

or similar.

I'll continue tomorrow... maybe I need a break...

Bogdan

Phil Harvey

hi Bogdan

Just one more thought.  Could there be a space on the line after -PreviewImage?  This would do it too.

Maybe try some other tag like -FileName to see if this works

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

BogdanH

Hi Phil,
I just tried:
-exif:orientation
-previewImage
-exif:colorSpace
450D.CR2

and I only get two lines output for both exif tags, without second line containing message".. bytes.. use -b option..". I also tried with v8.74, where I have previously cleared all existing ExifTool temp files (to exclude any corruption there).
As said, I'm working via pipes (if there's difference in case -stay_open is used with args file).

Bogdan

Phil Harvey

Hi Bogdan,

You're changing more than one thing at a time, so I don't know what difference is related to the problem.  There are 2 more tests to run:

1. Does the latest argfile work if you just add the -w option?

2. Do you still get the PreviewImage output when you just delete the -exif:colorSpace line from the latest argfile (without the -w option)?

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

BogdanH

Hi Phil,
Sorry if I'm confusing you by jumping uncontrolled from one example to another. What I was trying to explain in my last post was, that -PreviewImage tag seems to be handled by ExifTool as non-existing tag.

Forget all above... I have found the reason for my trouble and the reason is me. I owe you short explanation:
In my procedure, which handles all commands for -stay_open, I also use few "default" (user changeable) options; like -overwrite_original (or not), etc. and one of these options is -e ! -yes, I didn't realize -PreviewImage is actually composite data!! In short: I used -e and -PreviewImage at the same time.

I apologize wasting you time.. thank you for your patience,
Bogdan

Phil Harvey

Hi Bogdan,

Excellent.  I'm glad you found the problem.  Thanks for explaining.

To elaborate: PreviewImage is usually, but not always, a composite tag because most cameras reference this information with 2 other tags -- PreviewImageStart and PreviewImageLength.

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