Merge pull request #1384 from Exiv2/fix_1380_binary

Disable exiv2 option --binary (0.27->maintenance)
main
Robin Mills 5 years ago committed by GitHub
commit 3e78cac3f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH EXIV2 1 "May 12, 2020" .TH EXIV2 1 "Nov 6, 2020"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -132,7 +132,7 @@ exiv2 [ opt [arg] ]+ [ act ] file ...
.sp 1 .sp 1
option [arg] long option description option [arg] long option description
-a tim --adjust Modify time stamps. [+|-]HH[:MM[:SS[.mmm]]] -a tim --adjust Modify time stamps. [+|-]HH[:MM[:SS[.mmm]]]
-b --binary Show large binary values (default is to restrict them). -b --binary This option is obsolete and does nothing.
-c txt --comment JPEG comment string to set in the image ('modify' action). ... -c txt --comment JPEG comment string to set in the image ('modify' action). ...
-d tgt --delete Delete target(s) for the 'delete' action. ... -d tgt --delete Delete target(s) for the 'delete' action. ...
-D +-n --days Time adjustment by a positive or negative number of days ... -D +-n --days Time adjustment by a positive or negative number of days ...
@ -210,9 +210,6 @@ Set the log-level to 'd'(ebug), 'i'(nfo), 'w'(arning), 'e'(rror)
or 'm'(ute). The default log-level is 'w'. \fB\-Qm\fP is equivalent or 'm'(ute). The default log-level is 'w'. \fB\-Qm\fP is equivalent
to \fB\-q\fP. All log messages are written to standard error. to \fB\-q\fP. All log messages are written to standard error.
.TP .TP
.B \-b
The output from large binary values is to restricted by default. When outputting the value of a large value such as MakerNote, the default behaviour is to restrict the data and end with "...". The option --binary enables you to see all the data.
.TP
.B \-u .B \-u
Show unknown tags (default is to suppress tags which don't have a name). Show unknown tags (default is to suppress tags which don't have a name).
.TP .TP

@ -510,14 +510,9 @@ namespace Action {
return result ; return result ;
} }
static void binaryOutput(bool suppressLong,const std::ostringstream& os) static void binaryOutput(const std::ostringstream& os)
{ {
const int dots = 100; std::cout << os.str();
if ( suppressLong && os.str().length() > dots ) {
std::cout << os.str().substr(0,dots) << " ..." ;
} else {
std::cout << os.str();
}
} }
bool Print::printMetadatum(const Exiv2::Metadatum& md, const Exiv2::Image* pImage) bool Print::printMetadatum(const Exiv2::Metadatum& md, const Exiv2::Image* pImage)
@ -613,7 +608,7 @@ namespace Action {
} else { } else {
os << std::dec << md.value(); os << std::dec << md.value();
} }
binaryOutput(Params::instance().binary_,os); binaryOutput(os);
} }
if (Params::instance().printItems_ & Params::prTrans) { if (Params::instance().printItems_ & Params::prTrans) {
if (!first) if (!first)
@ -621,7 +616,7 @@ namespace Action {
first = false; first = false;
std::ostringstream os; std::ostringstream os;
os << std::dec << md.print(&pImage->exifData()); os << std::dec << md.print(&pImage->exifData());
binaryOutput(Params::instance().binary_,os) ; binaryOutput(os) ;
} }
if (Params::instance().printItems_ & Params::prHex) { if (Params::instance().printItems_ & Params::prHex) {
if (!first) if (!first)

Binary file not shown.

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
import system_tests
class test_pr_1384(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/pull/1384"
filename = "$data_path/pr_1384.exv"
commands = ["$exiv2 --grep ColorMatrix/i $filename"]
stderr = [""]
stdout = ["""Exif.Image.ColorMatrix1 SRational 9 10236/10000 -4532/10000 397/10000 -3403/10000 10623/10000 3223/10000 -242/10000 968/10000 8530/10000
Exif.Image.ColorMatrix2 SRational 9 8695/10000 -2558/10000 -648/10000 -5015/10000 12711/10000 2575/10000 -1279/10000 2215/10000 7514/10000
"""
]
retval = [0]
Loading…
Cancel
Save