0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00
Commit graph

177 commits

Author SHA1 Message Date
Michael Carey
c1a9dab401 Support TIFF images. 2017-08-31 13:04:10 -07:00
Will Norris
4533f0c68a allow crop options to be floats and negative
values between 0 and 1 have the same behavior as the size option - it is
treated as a percentage of the original image size.  Negative values for
cx and cy are calculated from the bottom and right edges of the image.
2017-08-31 07:27:35 +00:00
Will Norris
430baac0b0 minor cleanup to README and options docs
- remove unnecessary option example
- add option example for format changes
- move `-help` text to bottom of section
2017-08-31 07:25:02 +00:00
Will Norris
81cb74ef7e add evaluateFloat helper function 2017-08-31 04:42:52 +00:00
Will Norris
a33df59013 reorder rectangular crop parameters
change to x, y, width, height to more closely align with how parameters
are passed in the image package.
2017-08-31 03:50:25 +00:00
Maciej Tarnowski
1b70c6afd0 Implement rectangular crop functionality
Fixes #19
2017-08-31 03:50:25 +00:00
Will Norris
3211eeb13b bump to 0.6.0 2017-08-30 03:11:41 +00:00
Romanos
50f6f640b2 Enable CORS for 3rd party applications 2017-06-20 08:24:55 -07:00
Will Norris
d64b0f81c9 return 304 from TransformingTransport
If the caching headers in the request are valid, return a 304 response
instead of doing the transformation.

Ref #92
2017-06-14 20:25:56 -04:00
Will Norris
a7a04ebe7b simplify copyHeader func
- take simple http.Header values as input, rather than http.Response
- allow multiple headers to be copied to be specified.  If no headers
  specified, then copy all.
2017-06-14 17:22:45 -04:00
Will Norris
c81621ae35 rename check304 to should304
this reads a little better in if blocks
2017-06-14 16:34:34 -04:00
Will Norris
fb63cbe9df use strings.Join to construct options string 2017-06-01 09:53:29 -07:00
Will Norris
a85bfef357 quality adjustment is a transforming option
allow transformation where all that is changed is the image quality and
nothing else.
2017-06-01 09:40:12 -07:00
Will Norris
b5984d2822 update all downstream dependencies
no specific features I'm looking to add, just keeping thing up to date.
Unit tests and my manual testing seems like everything is still working
as expected.
2017-06-01 08:37:07 -07:00
Will Norris
17f19d612f vendor golang.org/x/image/webp and supporting libs 2017-06-01 08:32:26 -07:00
Will Norris
4f9f13200f readme: fix header levels for deploying section 2017-06-01 08:13:40 -07:00
Will Norris
328044540e add webp support (decode only)
if any transformation is requested, webp images will be encoded and
served as jpeg or png, defaulting to jpeg if no format is specified.

Fixes #88
2017-06-01 08:13:33 -07:00
Will Norris
b9cc9df4b6 add support for specifying output image format
For now, the options are "jpeg" and "png".  Gif is a little harder to
support because of the way we use the image/gif package to handle
animated gifs. I have also have trouble imagining someone wanting to use
gif over png. But if the need really exists, we can address it when it
comes up.

Fixes #89
2017-06-01 08:13:11 -07:00
Will Norris
2937bf84f6 readme: point to godoc for detail option docs
trying to keep this in sync between the two locations wasn't really
working and isn't necessary.
2017-06-01 07:29:09 -07:00
Will Norris
576b7c023a return 504 status for timeout errors
modify custom TimeoutHandler to return 504 error and switch imageproxy
to use that func.

Fixes #75
2016-11-29 15:42:08 -08:00
Will Norris
e180185856 add copy of net/http package
this includes an exact copy of the TimeoutHandler func and supporting
types from net/http, modified only to handle minor issues for imported
types.

Ref: #75
2016-11-29 15:42:08 -08:00
Will Norris
93166a5b20 add support for per-request timeout
Adds a -timeout flag for specifying the timeout.  Currently, this
returns a 503 response on timeout, though it should really be a 504,
since imageproxy is acting as a gateway.

Ref: #75
2016-11-29 15:42:07 -08:00
Denis Izmaylov
94dbd77d6e Add points about nginx and Dockerfile 2016-08-05 18:02:42 -07:00
Will Norris
49480c4693 add missing license headers on test files 2016-06-22 13:54:16 -07:00
xavren
79369ca8ef Copy header Link for canonical image SEO
fix format
2016-06-07 13:50:07 -04:00
Will Norris
b61992ec51 finish hadnling 'cleaned' remote URLs 2016-05-26 13:45:59 -07:00
Will Norris
a1af9aa8e2 handle 'cleaned' remote URLs
If imageproxy runs behind an http.ServeMux or certain web servers, the
double slash in the remote URL will get collapsed down to a single
slash.  (e.g. http://example.com/ becomes http:/example.com/).  This
is now handled by imageproxy directly.

Ref #65
2016-05-26 13:22:20 -07:00
Will Norris
a71584a63c skip transform if options don't request it
Fixes #64
2016-05-02 19:57:34 -07:00
Will Norris
d825852025 vendor: update gifresize to 6a22222
Fixes #61
2016-04-28 16:31:04 -07:00
Will Norris
8401001333 add missing LICENSE and README file from vendored libs 2016-03-10 10:58:56 -08:00
Phil Howell
1bdb3358b4 Add health-check endpoint 2016-01-12 17:19:27 +00:00
Will Norris
551fc372a1 print raw bytes to http response in tests
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.
2015-12-14 11:15:03 -08:00
Will Norris
27d53782b4 update allowed func to return error instead of bool
this allows returning a more accurate error message, particularly in the
case of an invalid referer header
2015-12-14 10:18:14 -08:00
Sevki
710a2ab1c9 docker: change go path
google's golang base image changed their gopath from /gopath to /go

fixes #51, fixes #52
2015-12-08 02:08:07 -08:00
Will Norris
87f06e8537 travis: run on new container-based infrastructure
docs: https://docs.travis-ci.com/user/migrating-from-legacy/
2015-12-07 23:19:01 -08:00
Will Norris
cd4f6a4cf9 bump minimum go version to 1.5 2015-12-07 23:14:57 -08:00
Will Norris
b4216d8da8 remove Proxy pointer from TransformingTransport
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
2015-12-07 23:06:02 -08:00
Will Norris
b967dc69a9 bump to 0.5.1 2015-12-07 22:42:25 -08:00
Will Norris
7a26a577a8 vendor: update willnorris.com/go/gifresize 2015-12-07 22:42:12 -08:00
Will Norris
d343a5f5ee bump version to 0.5.0 2015-12-07 21:35:35 -08:00
Will Norris
810ecedd69 deprecate cacheSize flag and remove docs
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
2015-12-07 21:09:56 -08:00
Will Norris
355a00f7b6 cmd: use trie for caching files on disk (fixes #50) 2015-12-07 20:20:42 -08:00
Will Norris
11370ac826 vendor: add sourcegraph/s3cache and dependencies
Adds:
 - github.com/kr/http/transport
 - github.com/sqs/s3
 - github.com/sqs/s3/s3util
 - sourcegraph.com/sourcegraph/s3cache
2015-12-07 20:04:55 -08:00
Victor Trac
ec96fcbc90 using s3 as caching store 2015-12-07 19:50:00 -08:00
Will Norris
f67209437a readme: fix line wrapping and some wording 2015-12-07 19:49:28 -08:00
Will Norris
b88f2b70e5 add -cache flag and default to no cache
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.
2015-12-04 15:54:00 -08:00
Will Norris
9d4058ca58 directly wrap ListenAndServe in log.Fatal call 2015-12-04 15:36:04 -08:00
Will Norris
8038795e8c fix travis build with vendored dependencies 2015-11-26 13:55:01 -08:00
Will Norris
69a7ccce71 vendor: add all of our dependencies 2015-11-26 12:41:45 -08:00
Will Norris
d9e4cf282a minor cleanup of resizeParams code 2015-11-26 12:05:13 -08:00