From 5d8b630ff28004ee2fc70ecb46e686ffae61d650 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 11 May 2015 19:29:25 -0700 Subject: [PATCH] omit empty quality from option string --- data.go | 4 +++- data_test.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data.go b/data.go index 6cfda2a..36aaa61 100644 --- a/data.go +++ b/data.go @@ -80,7 +80,9 @@ func (o Options) String() string { if o.FlipHorizontal { fmt.Fprintf(buf, ",%s", optFlipHorizontal) } - fmt.Fprintf(buf, ",%s%d", string(optQualityPrefix), o.Quality) + if o.Quality != 0 { + fmt.Fprintf(buf, ",%s%d", string(optQualityPrefix), o.Quality) + } return buf.String() } diff --git a/data_test.go b/data_test.go index 4e4f616..63513b8 100644 --- a/data_test.go +++ b/data_test.go @@ -26,7 +26,7 @@ func TestOptions_String(t *testing.T) { }{ { emptyOptions, - "0x0,q0", + "0x0", }, { Options{1, 2, true, 90, true, true, 80},