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

35 commits

Author SHA1 Message Date
Will Norris
7ba3f124eb cleanup license headers and contributing docs
- switch to "project authors" style copyright.  Instead of an AUTHORS
  file (https://opensource.google/docs/releasing/authors/), I just list
  Google as a major copyright holder in the README.
- use SPDX style license headers in source files
- remove CLA requirement from contributing docs
2021-03-10 12:24:13 -08:00
Will Norris
7e21abe7d1 remove ineffective break statement 2020-09-09 22:44:48 -07:00
Will Norris
7eeacfca7a standardize copyright statements (Inc -> LLC) 2019-11-30 10:04:17 -08:00
Will Norris
c0a97f6742 simplify data.go and tests
remove unecessary string casting, and simplify duplicate tests.  Also
don't use struct literals for test values.
2019-10-13 19:28:22 -07:00
Ethan Mick
7af1b52eef Fix signature documentation link location (#180)
Correct link from non-existent wiki page to new doc location on master
branch.
2019-05-13 08:28:08 -07:00
Will Norris
ae2a31cc01 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).
2019-03-27 17:20:16 +00:00
Will Norris
37c9f4d6ab preserve original URL encoding
fixes #115
2017-10-05 17:57:41 +00:00
Will Norris
afbd254cdc add smartcrop feature
fixes #55
2017-09-27 00:54:15 +00:00
Will Norris
817908938e allow forcing encoding as tiff 2017-08-31 17:06:22 -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
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
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
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
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
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
Connor Peet
9213c93c94 Add ability to restrict http referrer 2015-08-15 10:36:07 -07:00
Rune Madsen
4e60c683b0 scaleup flag 2015-08-12 14:39:38 -04:00
Will Norris
a9efefc8e7 add request signature support to Proxy 2015-05-14 15:30:07 -07:00
Will Norris
5d8b630ff2 omit empty quality from option string 2015-05-11 19:29:25 -07:00
Will Norris
b1de3a9dd6 add String method to Request 2015-05-11 17:12:03 -07:00
Will Norris
85e5dcdddc rsc.io/grind cleanup 2015-05-04 10:26:22 -07:00
Will Norris
ad54d71881 first pass at supporting a default base URL
this allows remote images to be specified as relative URLs, relative to
the `DefaultBaseURL` field.  Fixes #15.
2015-04-28 08:25:10 -07:00
Pete Smith
e7b0a5b88c Add quality option
- Added 'q' option to specify quality (used for JPEGs)
- Updated tests
- Update documentation
2015-02-12 17:49:43 +00:00
Will Norris
0980ea64a0 define constants for option strings
this prevents extra allocations in ParseOptions and cleans up the code a
bit, but doesn't actually improve performance in any meaningful way.
2015-01-25 00:30:15 -08:00
Will Norris
54ddf21df2 add docs and cleanup data code
- simplify ParseOptions
- add lots of docs to ParseOptions and NewRequest
- cleanup some data tests

No behavioral changes.
2014-11-23 15:41:55 -08:00
Will Norris
2dd79ebd20 minor cleanup of error messages
- used same string for logging and error response to ensure they stay in
  sync
- pass through any http error status codes from remote URLs
2014-11-21 17:59:51 -08:00
Will Norris
dae09a8c9d rename proxy.go and remove old data package doc 2014-11-19 22:02:34 -08:00
Will Norris
4a5f24e4ec there's no need for Options to be a pointer 2014-11-19 21:59:52 -08:00
Will Norris
a74e590181 restructure imageproxy package
- move binary from imageproxy.go to cmd/imageproxy/main.go
- move proxy package up to top level
2014-07-30 18:23:43 -07:00
Renamed from proxy/data.go (Browse further)