Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/willnorris/imageproxy
/ functions
Functions
116 in github.com/willnorris/imageproxy
⨍
Functions
116
◇
Types & classes
16
↓ 52 callers
Function
newImage
newImage creates a new NRGBA image with the specified dimensions and pixel color data. If the length of pixels is 1, the entire image is filled with
transform_test.go:33
↓ 18 callers
Method
Get
Get retrieves the cached data for the provided key.
cache.go:10
↓ 17 callers
Method
String
()
data.go:91
↓ 16 callers
Method
String
()
cmd/imageproxy/main.go:136
↓ 15 callers
Method
Set
Set caches the provided data.
cache.go:13
↓ 9 callers
Method
Header
()
third_party/http/server.go:110
↓ 8 callers
Function
Transform
Transform the provided image. img should contain the raw bytes of an encoded image in one of the supported formats (gif, jpeg, or png). The bytes of
transform.go:41
↓ 8 callers
Function
evaluateFloat
evaluateFloat interprets the option value f. If f is between 0 and 1, it is interpreted as a percentage of max, otherwise it is treated as an absolute
transform.go:134
↓ 8 callers
Method
logf
(format string, v ...any)
imageproxy.go:524
↓ 7 callers
Function
transformImage
transformImage modifies the image m based on the transformations specified in opt.
transform.go:274
↓ 6 callers
Method
Error
()
data.go:44
↓ 6 callers
Method
Write
(p []byte)
third_party/http/server.go:112
↓ 6 callers
Method
log
(v ...any)
imageproxy.go:516
↓ 5 callers
Method
ServeHTTP
ServeHTTP handles incoming requests.
imageproxy.go:200
↓ 5 callers
Function
copyHeader
copyHeader copies values for specified headers from src to dst, adding to any existing values with the same header name.
imageproxy.go:360
↓ 5 callers
Function
hostMatches
hostMatches returns whether the host in u matches one of hosts.
imageproxy.go:424
↓ 4 callers
Function
NewRequest
NewRequest parses an http.Request into an imageproxy Request. Options and the remote image URL are specified in the request path, formatted as: {opti
data.go:357
↓ 4 callers
Function
ParseOptions
ParseOptions parses str as a list of comma separated transformation options. The options can be specified in in order, with duplicate options overwrit
data.go:252
↓ 4 callers
Method
WriteHeader
(code int)
third_party/http/server.go:124
↓ 4 callers
Function
sign
(key string, s string, urlOnly bool)
cmd/imageproxy-sign/main.go:40
↓ 3 callers
Function
NewProxy
NewProxy constructs a new proxy. The provided http RoundTripper will be used to fetch remote URLs. If nil is provided, http.DefaultTransport will be
imageproxy.go:109
↓ 3 callers
Function
keyToFilename
(key string)
internal/s3cache/s3cache.go:80
↓ 3 callers
Method
object
(key string)
internal/gcscache/gcscache.go:62
↓ 3 callers
Function
parseKey
(s string)
cmd/imageproxy-sign/main.go:65
↓ 3 callers
Function
peekContentType
peekContentType peeks at the first 512 bytes of p, and attempts to detect the content type. Returns empty string if error occurs.
imageproxy.go:350
↓ 3 callers
Function
should304
should304 returns whether we should send a 304 Not Modified in response to req, based on the response resp. This is determined using the last modifie
imageproxy.go:492
↓ 2 callers
Method
Delete
Delete deletes the cached data at the specified key.
cache.go:16
↓ 2 callers
Method
String
String returns the request URL as a string, with r.Options encoded in the URL fragment.
data.go:321
↓ 2 callers
Method
allowed
allowed determines whether the specified request contains an allowed referrer, host, and signature. It returns an error if the request is not allowed
imageproxy.go:382
↓ 2 callers
Function
contentTypeMatches
contentTypeMatches returns whether contentType matches one of the allowed patterns.
imageproxy.go:409
↓ 2 callers
Function
cropParams
cropParams calculates crop rectangle parameters to keep it in image bounds
transform.go:174
↓ 2 callers
Function
diskCache
(path string)
cmd/imageproxy/main.go:213
↓ 2 callers
Function
diskCache
(path string)
caddy/module.go:158
↓ 2 callers
Function
parseURL
parseURL parses s as a URL, handling URLs that have been munged by path.Clean or a webserver that collapses multiple slashes. The returned enc bool in
data.go:406
↓ 2 callers
Function
parseURL
parseURL parses s as either an imageproxy request URL or a remote URL with options in the URL fragment. Any existing signature values are stripped, a
cmd/imageproxy-sign/main.go:75
↓ 2 callers
Function
referrerMatches
returns whether the referrer from the request is in the host list.
imageproxy.go:448
↓ 2 callers
Function
resizeParams
resizeParams determines if the image needs to be resized, and if so, the dimensions to resize to.
transform.go:146
↓ 2 callers
Method
transform
transform returns whether o includes transformation options. Some fields are not transform related at all (like Signature), and others only apply in
data.go:143
↓ 2 callers
Function
trimEdges
trimEdges returns a new image with solid color borders of the image removed. The pixel at the top left corner is used to match the border color.
transform.go:330
↓ 2 callers
Method
updateCacheHeaders
updateCacheHeaders updates the cache-control headers in the provided headers. If the cache-control header includes the 'private' directive, then 'no-
imageproxy.go:151
↓ 2 callers
Function
validSignature
validSignature returns whether the request signature is valid.
imageproxy.go:458
↓ 2 callers
Method
writeHeader
(code int)
third_party/http/server.go:133
↓ 1 callers
Function
New
New constructs a Cache storing files in the specified GCS bucket. If prefix is not empty, objects will be prefixed with that path. Credentials should
internal/gcscache/gcscache.go:77
↓ 1 callers
Function
New
New constructs a cache configured using the provided URL string. URL should be of the form: "s3://region/bucket/optional-path-prefix". Credentials s
internal/s3cache/s3cache.go:90
↓ 1 callers
Function
Parse
Parse takes a prefix string and exposes environment variables for all flags in the default FlagSet (flag.CommandLine) in the form of PREFIX_FLAGNAME.
third_party/envy/envy.go:15
↓ 1 callers
Method
RoundTrip
RoundTrip implements the http.RoundTripper interface.
imageproxy.go:551
↓ 1 callers
Method
errorBody
()
third_party/http/server.go:50
↓ 1 callers
Function
exifOrientation
read EXIF orientation tag from r and adjust opt to orient image correctly.
transform.go:222
↓ 1 callers
Function
keyToFilename
(key string)
internal/gcscache/gcscache.go:67
↓ 1 callers
Function
lruCache
lruCache creates an LRU Cache with the specified options of the form "maxSize:maxAge". maxSize is specified in megabytes, maxAge is a duration.
cmd/imageproxy/main.go:195
↓ 1 callers
Function
parseCache
parseCache parses c returns the specified Cache implementation.
cmd/imageproxy/main.go:157
↓ 1 callers
Function
parseCache
parseCache parses c returns the specified Cache implementation.
caddy/module.go:134
↓ 1 callers
Function
update
update takes a prefix string p and *flag.FlagSet. Each flag in the FlagSet is exposed as an upper case environment variable prefixed with p. Any flag
third_party/envy/envy.go:23
Method
CaddyModule
CaddyModule returns the Caddy module information.
caddy/module.go:49
Method
Delete
(string)
cache.go:26
Method
Delete
(key string)
internal/gcscache/gcscache.go:56
Method
Delete
(key string)
internal/s3cache/s3cache.go:67
Method
Get
(string)
cache.go:24
Method
Get
(key string)
internal/gcscache/gcscache.go:27
Method
Get
(key string)
internal/s3cache/s3cache.go:30
Function
ParseCacheControl
(headers http.Header)
third_party/httpcache/httpcache.go:11
Method
Provision
(ctx caddy.Context)
caddy/module.go:56
Method
RoundTrip
(req *http.Request)
imageproxy_test.go:343
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler)
caddy/module.go:77
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
third_party/http/server.go:57
Method
Set
(string, []byte)
cache.go:25
Method
Set
(key string, value []byte)
internal/gcscache/gcscache.go:46
Method
Set
(key string, value []byte)
internal/s3cache/s3cache.go:54
Method
Set
(value string)
cmd/imageproxy/main.go:114
Method
Set
(value string)
cmd/imageproxy/main.go:140
Method
String
()
cmd/imageproxy/main.go:110
Method
String
()
third_party/httpcache/httpcache.go:29
Function
TestAllowed
(t *testing.T)
imageproxy_test.go:95
Function
TestContentTypeMatches
(t *testing.T)
imageproxy_test.go:762
Function
TestCopyHeader
(t *testing.T)
imageproxy_test.go:47
Function
TestCropParams
(t *testing.T)
transform_test.go:68
Function
TestHostMatches
(t *testing.T)
imageproxy_test.go:176
Function
TestNewRequest
Test that request URLs are properly parsed into Options and RemoteURL. This test verifies that invalid remote URLs throw errors, and that valid combi
data_test.go:103
Function
TestNewRequest_BaseURL
(t *testing.T)
data_test.go:246
Function
TestNopCache
(t *testing.T)
cache_test.go:8
Function
TestOptions_String
(t *testing.T)
data_test.go:14
Function
TestParseKey
(t *testing.T)
cmd/imageproxy-sign/main_test.go:60
Function
TestParseKey_FilePath
(t *testing.T)
cmd/imageproxy-sign/main_test.go:71
Function
TestParseOptions
(t *testing.T)
data_test.go:48
Function
TestParseURL
(t *testing.T)
cmd/imageproxy-sign/main_test.go:95
Function
TestPeekContentType
(t *testing.T)
imageproxy_test.go:32
Function
TestProxy_ServeHTTP
(t *testing.T)
imageproxy_test.go:545
Function
TestProxy_ServeHTTP_cached304
(t *testing.T)
imageproxy_test.go:603
Function
TestProxy_ServeHTTP_is304
test that 304 Not Modified responses are returned properly.
imageproxy_test.go:583
Function
TestProxy_ServeHTTP_maxRedirects
(t *testing.T)
imageproxy_test.go:650
Function
TestProxy_UpdateCacheHeaders
(t *testing.T)
imageproxy_test.go:392
Function
TestProxy_log
(t *testing.T)
imageproxy_test.go:678
Function
TestProxy_log_default
(t *testing.T)
imageproxy_test.go:698
Function
TestReferrerMatches
(t *testing.T)
imageproxy_test.go:206
Function
TestResizeParams
(t *testing.T)
transform_test.go:45
Function
TestShould304
(t *testing.T)
imageproxy_test.go:259
Function
TestSign
(t *testing.T)
cmd/imageproxy-sign/main_test.go:15
Function
TestSign_Errors
(t *testing.T)
cmd/imageproxy-sign/main_test.go:41
Function
TestSign_URLOnly
(t *testing.T)
cmd/imageproxy-sign/main_test.go:28
Function
TestTranform_ImageTooLarge
(t *testing.T)
transform_test.go:145
next →
1–100 of 116, ranked by callers