mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
omit empty quality from option string
This commit is contained in:
parent
b1de3a9dd6
commit
5d8b630ff2
2 changed files with 4 additions and 2 deletions
4
data.go
4
data.go
|
@ -80,7 +80,9 @@ func (o Options) String() string {
|
||||||
if o.FlipHorizontal {
|
if o.FlipHorizontal {
|
||||||
fmt.Fprintf(buf, ",%s", optFlipHorizontal)
|
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()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestOptions_String(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
emptyOptions,
|
emptyOptions,
|
||||||
"0x0,q0",
|
"0x0",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Options{1, 2, true, 90, true, true, 80},
|
Options{1, 2, true, 90, true, true, 80},
|
||||||
|
|
Loading…
Reference in a new issue