mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 12:56:23 +02:00
allow percentage sizes
change height and width options to be floats, and interpret values between 0 and 1 to be percentages. For example, an options strings of "0.5x" specifies 50% width and proportional height.
This commit is contained in:
parent
036d0c51c4
commit
cd1112f7ac
4 changed files with 28 additions and 12 deletions
|
|
@ -88,6 +88,10 @@ func TestNewRequest(t *testing.T) {
|
|||
"http://localhost/1x2,fit/http://example.com/",
|
||||
"http://example.com/", &data.Options{1, 2, true}, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/0.1x0.2,fit/http://example.com/",
|
||||
"http://example.com/", &data.Options{0.1, 0.2, true}, false,
|
||||
},
|
||||
}
|
||||
|
||||
for i, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue