Project

General

Profile

What does exit code 253 mean?

Added by Torsten Bronger over 8 years ago

If I call exiv2 like this:

exiv2 -g Exif.Photo.LensModel -g Exif.Photo.FocalLength -g Exif.Photo.FNumber *.ARW

I get an exit code of 253. The output is as expected though, and I cannot see an error message. What does the exit code 253 mean?


Replies (9)

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

I feel that's -3 (but an unsigned byte). However I don't know off hand what that means either!

I can't reproduce this with either 0.24 (which is about to ship).

660 rmills@rmillsmpb:~/Downloads $ exiv2 -V
exiv2 0.24 001800 (64 bit build)
Copyright (C) 2004-2013 Andreas Huggel.
...
662 rmills@rmillsmpb:~/Downloads $ exiv2 -g Exif.Photo.LensModel -g Exif.Photo.FocalLength -g Exif.Photo.FNumber ~/Pictures/Wallpapers/Grand\ Tetons\,\ WY.jpg 
Exif.Photo.FNumber                           Rational    1  F8
Exif.Photo.FocalLength                       Rational    1  6.2 mm
663 rmills@rmillsmpb:~/Downloads $ echo $?
0
664 rmills@rmillsmpb:~/Downloads $ 

Nor with the current 0.23 release version built from exiv2-0.23.tar.gz:
667 rmills@rmillsmpb:~/Downloads $ exiv2 -V
exiv2 0.23 001700 (64 bit build)
Copyright (C) 2004-2012 Andreas Huggel.
...
668 rmills@rmillsmpb:~/Downloads $ exiv2 -g Exif.Photo.LensModel -g Exif.Photo.FocalLength -g Exif.Photo.FNumber ~/Pictures/Wallpapers/Grand\ Tetons\,\ WY.jpg 
Exif.Photo.FNumber                           Rational    1  F8
Exif.Photo.FocalLength                       Rational    1  6.2 mm
669 rmills@rmillsmpb:~/Downloads $ echo $?
0
670 rmills@rmillsmpb:~/Downloads $ 

May I ask you to attach a test file to this discussion with which I reproduce the error. And can you tell me
  1. which platform are you running (Mac/Linux/Windows).
  2. If it's Windows, what was the build environment (Cygwin/MinGW/msvc/msvc64)
  3. the version of exiv2 being used (or the svn revision if built from the trunk)

You can get the svn revision number of the code with the following one liner:

757 rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ for i in $(find . -name "*.cpp"); do grep EXIV2_RCSID $i; done | cut -d' ' -f 4 | sort --numeric | tail -1
2715
758 rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ 

Robin

RE: What does exit code 253 mean? - Added by Torsten Bronger over 8 years ago

I run Ubuntu 12.10 and 13.04, exiv2 0.23.

I can reproduce it even easier with

exiv2 -pa DSC03198.ARW

Without the "-pa", the exit code is 0. I uploaded the RAW at <https://bob.ipv.kfa-juelich.de/bronger/DSC03198.ARW&gt;.

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

Thanks, Torsten. Unfortunately, I get "404 Not found" from your link to DSC03198.ARW.

RE: What does exit code 253 mean? - Added by Niels Kristian Bech Jensen over 8 years ago

You have to remove the closing '>' (%3E) from the link.

Best regards,
Niels Kristian Bech Jensen

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

Thanks, Niels. I should have figured that for myself. I've reproduced the 253 on the Mac and I will investigate.

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

Torsten

This is being caused by the code in actions.cpp function printMetatdata() returning -3 when it detects the absence of any of the metadata types { exif | xmp | Iptc }. As you have said, the output is correct and the return value of the program is not the expect 0. We could raise a bug report on this and it will be resolved in v0.25 of the library. (0.24 is about to ship and I'm reluctant to submit to the trunk at the moment). I'll be happy to accept your input and opinion about the best course of action.

Robin

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

Here's more information to explain your command exiv2 -pa DSC03198.ARW . The -v (verbose) flag will generate an error message on stderr.

rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ src/.libs/exiv2 -vpa ~/Downloads/DSC03198.ARW > /dev/null  # display Exif, IPTC and XMP types.  show stderr and ignore stdout
/Users/rmills/Downloads/DSC03198.ARW: No IPTC data found in the file
/Users/rmills/Downloads/DSC03198.ARW: No XMP data found in the file
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ echo $?
253
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ src/.libs/exiv2 -v ~/Downloads/DSC03198.ARW > /dev/null # default (display only Exif summary metadata)
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ echo $?
0
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ src/.libs/exiv2 -v ~/Downloads/DSC03198.ARW | wc # count the output lines
      27     112     803
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ src/.libs/exiv2 -vpi ~/Downloads/DSC03198.ARW > /dev/null # display only IPTC metadata
/Users/rmills/Downloads/DSC03198.ARW: No IPTC data found in the file
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ echo $?
253
rmills@rmillsmpb:~/gnu/exiv2/exiv2-0.23 $ 
So, you can see that the -pa option causes exiv2 to return 253 because there is not XMP and IPTC information in the file.

RE: What does exit code 253 mean? - Added by Torsten Bronger over 8 years ago

FWIW, I was surprised by this behaviour, and I think that something simple like

exiv2 -g Exif.Photo.LensModel DSC03211.ARW

should not complain that there was no XMP/IPTC metadata in the file. I don't see a reason why the absence of XMP/IPTC metadata could be important to the caller. So I vote for changing this behaviour. The timeline of this change doesn't matter to be though since I have a workaround for my purposes.

Thanks for the insights nevertheless!

RE: What does exit code 253 mean? - Added by Robin Mills over 8 years ago

Torsten

I have raised an issue: http://dev.exiv2.org/issues/917 and it will be dealt with for the 0.25 release (expected around the end of 2013).

Robin

    (1-9/9)