diff --git a/README.md b/README.md index 56b0ea5..b3c46fc 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ source image][small-things], which measures 1024 by 678 pixels. Options | Meaning | Image --------|------------------------------------------|------ 200x | 200px wide, proportional height | 200x -0.15x | 15% original width, proportional height | 0.15x -x100 | 100px tall, proportional width | x100 +x0.15 | 15% original height, proportional width | x0.15 100x150 | 100 by 150 pixels, cropping as needed | 100x150 100 | 100px square, cropping as needed | 100 150,fit | scale to fit 150px square, no cropping | 150,fit 100,r90 | 100px square, rotated 90 degrees | 100,r90 100,fv,fh | 100px square, flipped horizontal and vertical | 100,fv,fh 200x,q60 | 200px wide, proportional height, 60% quality | 200x,q60 +200x,png | 200px wide, converted to PNG format | 200x,png Transformation also works on animated gifs. Here is [this source image][material-animation] resized to 200px square and rotated 270 degrees: @@ -169,12 +169,6 @@ If both a whiltelist and signatureKey are specified, requests can match either. In other words, requests that match one of the whitelisted hosts don't necessarily need to be signed, though they can be. - -Run `imageproxy -help` for a complete list of flags the command accepts. If -you want to use a different caching implementation, it's probably easiest to -just make a copy of `cmd/imageproxy/main.go` and customize it to fit your -needs... it's a very simple command. - ### Default Base URL ### Typically, remote images to be proxied are specified as absolute URLs. @@ -200,11 +194,17 @@ However, you can use the `scaleUp` command-line flag to allow this to happen: ### WebP support ### Imageproxy can proxy remote webp images, but they will be served in either jpeg -or png format (this is because the golang webp library only support decoding) -if any transformation is requested. If no format is specified, imageproxy will -use jpeg by default. If no transformation is requested (for example, if you -are just using imageproxy as an SSL proxy) then the original webp image will be -served as-is without any format conversion. +or png format (this is because the golang webp library only supports webp +decoding) if any transformation is requested. If no format is specified, +imageproxy will use jpeg by default. If no transformation is requested (for +example, if you are just using imageproxy as an SSL proxy) then the original +webp image will be served as-is without any format conversion. + + +Run `imageproxy -help` for a complete list of flags the command accepts. If +you want to use a different caching implementation, it's probably easiest to +just make a copy of `cmd/imageproxy/main.go` and customize it to fit your +needs... it's a very simple command. ## Deploying ## diff --git a/data.go b/data.go index 3dd5cb8..1749e9c 100644 --- a/data.go +++ b/data.go @@ -216,14 +216,13 @@ func (o Options) transform() bool { // // 0x0 - no resizing // 200x - 200 pixels wide, proportional height -// 0.15x - 15% original width, proportional height -// x100 - 100 pixels tall, proportional width +// x0.15 - 15% original height, proportional width // 100x150 - 100 by 150 pixels, cropping as needed // 100 - 100 pixels square, cropping as needed // 150,fit - scale to fit 150 pixels square, no cropping // 100,r90 - 100 pixels square, rotated 90 degrees // 100,fv,fh - 100 pixels square, flipped horizontal and vertical -// 200x,q80 - 200 pixels wide, proportional height, 80% quality +// 200x,q60 - 200 pixels wide, proportional height, 60% quality // 200x,png - 200 pixels wide, converted to PNG format // cw100,ch200 - crop fragment that starts at (0,0), is 100px wide and 200px tall // cw100,ch200,cx10,cy20 - crop fragment that start at (10,20) is 100px wide and 200px tall