mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-27 22:06:24 +02:00
sort options before converting to string
This makes the options string more predictable, and easier to compute by other programs. This is primarily being done to enable signatures that include option values (see #145).
This commit is contained in:
parent
cf54b2cf2c
commit
ae2a31cc01
3 changed files with 16 additions and 4 deletions
|
|
@ -33,19 +33,19 @@ func TestOptions_String(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Options{1, 2, true, 90, true, true, 80, "", false, "", 0, 0, 0, 0, false},
|
||||
"1x2,fit,r90,fv,fh,q80",
|
||||
"1x2,fh,fit,fv,q80,r90",
|
||||
},
|
||||
{
|
||||
Options{0.15, 1.3, false, 45, false, false, 95, "c0ffee", false, "png", 0, 0, 0, 0, false},
|
||||
"0.15x1.3,r45,q95,sc0ffee,png",
|
||||
"0.15x1.3,png,q95,r45,sc0ffee",
|
||||
},
|
||||
{
|
||||
Options{0.15, 1.3, false, 45, false, false, 95, "c0ffee", false, "", 100, 200, 0, 0, false},
|
||||
"0.15x1.3,r45,q95,sc0ffee,cx100,cy200",
|
||||
"0.15x1.3,cx100,cy200,q95,r45,sc0ffee",
|
||||
},
|
||||
{
|
||||
Options{0.15, 1.3, false, 45, false, false, 95, "c0ffee", false, "png", 100, 200, 300, 400, false},
|
||||
"0.15x1.3,r45,q95,sc0ffee,png,cx100,cy200,cw300,ch400",
|
||||
"0.15x1.3,ch400,cw300,cx100,cy200,png,q95,r45,sc0ffee",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue