How to disable "(No XMP data found in the file)" message?
Added by Thomas Bourdon over 5 years ago
Hi,
Since I upgrade from exiv2-0.23 to 0.25, I have all the time the message "(No XMP data found in the file)". I tried the --quiet option but the message is still here. Did I miss anything?
Thanks for helping me.
Replies (2)
RE: How to disable "(No XMP data found in the file)" message? - Added by Robin Mills over 5 years ago
Thomas
This warning in written to errout when a class of metadata (such as Xmp) is empty. We also set the return code to 253 (-3). There was a complaint that we were setting a non-zero code without a warning. So in v0.25, when we set the non-zero return value,_* we also*_ report the warning. This is the behaviour you describe.
702 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ curl --silent -O http://clanmills.com/Stonehenge.jpg 703 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -px Stonehenge.jpg | wc # how many lines of Xmp metadata? 3 14 238 704 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -dx Stonehenge.jpg # delete the Xmp metadata 705 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -px Stonehenge.jpg | wc Stonehenge.jpg: (No XMP data found in the file) 0 0 0 706 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -px Stonehenge.jpg # print the Xmp metadata Stonehenge.jpg: (No XMP data found in the file) 707 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ echo $? 253 708 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -pa Stonehenge.jpg > /dev/null # ignore the output Stonehenge.jpg: (No XMP data found in the file) # message on errout 709 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ echo $? # what's the return value? 253 710 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ exiv2 -pie Stonehenge.jpg > /dev/nul # print IPTC and Exif tags 711 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $ echo $? # what's the return value 0 712 rmills@rmillsmbp:~/gnu/exiv2/v0.25 $There are at least a couple of ways to avoid the warning:
- ignore errout
$ exiv2 -pa image... 2>/dev/null
- don't ask exiv2 for Xmp
$ exiv2 -pie image...
RE: How to disable "(No XMP data found in the file)" message? - Added by Thomas Bourdon over 5 years ago
Hi,
Thanks to you. You learnt me a lot of things.
I decided to simply use
exiv2 … 2> /dev/null
like you suggest me and it works fine.