Skip to content

Commit b52b6db

Browse files
authored
Output of -PV was not suitable for inputting to -m-, key was missing. (#1970)
* Output of -PV was not suitable for inputting to -m-, key was missing. Fix #1969 * Make V flag to -P also print the type This makes -PV work also for non-built-in tags (of which their type is not known by exiv2). * Adjust man to accomodate for the V flag change
1 parent c28e501 commit b52b6db

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed

doc/cmdxmp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set Xmp.dc.creator XmpSeq "1) The first creator"
4040
set Xmp.dc.creator "2) The second creator"
4141
set Xmp.dc.creator "3) And another one"
4242

43-
# A language alternative. The default entry of a langauge alternative
43+
# A language alternative. The default entry of a language alternative
4444
# doesn't need a language qualifier.
4545
set Xmp.dc.description LangAlt lang=de-DE Hallo, Welt
4646
set Xmp.dc.description LangAlt Hello, World

exiv2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ as well as data columns included in the print output. Valid flags are:
571571
| c | Number of components (for single entry types, the number of **sizeof('type')** in 'size'. For multi-entry types, the number of entries. See [Exif/IPTC/XMP types](#exiv2_types)) |
572572
| s | Size in bytes of vanilla output (see note in [Exif 'Comment' values](#exif_comment_values)). Some types include a *NULL* character in the size (see [Exif/IPTC/XMP types](#exiv2_types)) |
573573
| v | Plain data value (vanilla values, i.e., untranslated) |
574-
| V | Plain data value and the word 'set ' (see ['MODIFY' COMMANDS](#modify_cmds))|
574+
| V | Plain data value, data type and the word 'set ' (see ['MODIFY' COMMANDS](#modify_cmds))|
575575
| t | Interpreted (translated) human-readable data values (includes plain vanilla values) |
576576
| h | Hex dump of the data |
577577

@@ -1292,10 +1292,10 @@ $ exiv2 --Modify "set Iptc.Application2.Caption Stonehenge" --modify cmdfile.txt
12921292
<div id="gen_modify_cmds">
12931293

12941294
A list of modify commands can be generated from an existing file using
1295-
[--Print Vkyv](#Print_flgs). For example, only displaying the 'dc'
1295+
[--Print V](#Print_flgs). For example, only displaying the 'dc'
12961296
'modify' commands:
12971297
```
1298-
$ exiv2 --Print Vkyv --grep dc Stonehenge.jpg
1298+
$ exiv2 --Print V --grep dc Stonehenge.jpg
12991299
set Xmp.dc.description LangAlt lang="x-default" Classic View
13001300
set Xmp.dc.Family XmpBag Robin
13011301
```

src/exiv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ int Params::evalPrintFlags(const std::string& optArg)
720720
printItems_ |= prHex;
721721
break;
722722
case 'V':
723-
printItems_ |= prSet | prValue;
723+
printItems_ |= prSet | prKey | prType | prValue;
724724
break;
725725
default:
726726
std::cerr << progname() << ": " << _("Unrecognized print item") << " `" << i << "'\n";

test/data/cmdxmp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set Xmp.dc.creator XmpSeq "1) The first creator"
4040
set Xmp.dc.creator "2) The second creator"
4141
set Xmp.dc.creator "3) And another one"
4242

43-
# A language alternative. The default entry of a langauge alternative
43+
# A language alternative. The default entry of a language alternative
4444
# doesn't need a language qualifier.
4545
set Xmp.dc.description LangAlt lang=de-DE Hallo, Welt
4646
set Xmp.dc.description LangAlt Hello, World
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import system_tests
4+
5+
6+
class TestPrintPlainWithSet(metaclass=system_tests.CaseMeta):
7+
8+
url = "https://github.com/Exiv2/exiv2/issues/1969"
9+
10+
filename = "$data_path/smiley1.jpg"
11+
commands = ["$exiv2 -K Exif.Image.ImageDescription -PV $filename"]
12+
stdout = [
13+
"""set Exif.Image.ImageDescription Ascii Well it is a smiley that happens to be green
14+
"""
15+
]
16+
retval = [0]

tests/bugfixes/redmine/test_issue_1137.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class MetadataPiping(metaclass=system_tests.CaseMeta):
1818
"""$exiv2 -pa --grep GPSL $filename"""
1919
]
2020

21-
output_grep_GPSL = """set Exif.GPSInfo.GPSLatitudeRef N
22-
set Exif.GPSInfo.GPSLatitude 51/1 106969/10000 0/1
23-
set Exif.GPSInfo.GPSLongitudeRef W
24-
set Exif.GPSInfo.GPSLongitude 1/1 495984/10000 0/1
21+
output_grep_GPSL = """set Exif.GPSInfo.GPSLatitudeRef Ascii N
22+
set Exif.GPSInfo.GPSLatitude Rational 51/1 106969/10000 0/1
23+
set Exif.GPSInfo.GPSLongitudeRef Ascii W
24+
set Exif.GPSInfo.GPSLongitude Rational 1/1 495984/10000 0/1
2525
"""
2626

2727
stdin = [

0 commit comments

Comments
 (0)