this has actually always been failing to transform the image, but wasn't
being caught by our tests because we are currently only checking the
response code.
This pointer was only needed to pass along the scaleUp option. In order
to prevent someone from specifying the scaleUp option on an individual
request against the owner's wishes, we didn't encode or decode that
field on the Options struct. Instead, we stored the value on the Proxy
object and then set it on the Options struct inside the
TransformingTransport. This worked, but I never really liked binding
those two together.
Instead, we now treat scaleUp as a normal Option field, encoding and
decoding it with all the others. The primary difference is that the
initial value from the request URL will always be overwritten with
whatever is set in Proxy.ScaleUp. This decouples the
TransformingTransport from the Proxy, but prevents the option from being
set in the request URL.
Modifies #37
this flag was never actually doing what I thought it was in the first
place.
Also fix up a few instances of cacheDir still be used in config files
fixes#45
The imageproxy command no longer uses the in-memory cache by default.
Instead, no caching is enabled by default and the in-memory cache can be
enabled by passing `-cache memory`.
The -cache flag also supports specifying directories, and therefore
replaces hte older -cacheDir flag. cacheDir is still supported for
compatibility, but is deprecated and will be removed in the future.
This also sets us up to add support for additional caching backends in
the future.
Partial fix for #49.
- move out of main package
- export Process func
- Process now accepts an io.Reader and io.Writer as input rather than
working directly on files
- Process accepts a transform function as input rather than always
resizing to a fixed size
imported from github.com/dpup/go-scratch/gif-resize under Apache 2.0
license. License header added to gifresize.go rather than include the
full LICENSE file, since imageproxy is under the Apache 2.0 also and we
already have a copy of the license in the root of this repo.