MCPcopy Create free account

hub / github.com/willnorris/imageproxy / functions

Functions116 in github.com/willnorris/imageproxy

↓ 52 callersFunctionnewImage
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 callersMethodGet
Get retrieves the cached data for the provided key.
cache.go:10
↓ 17 callersMethodString
()
data.go:91
↓ 16 callersMethodString
()
cmd/imageproxy/main.go:136
↓ 15 callersMethodSet
Set caches the provided data.
cache.go:13
↓ 9 callersMethodHeader
()
third_party/http/server.go:110
↓ 8 callersFunctionTransform
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 callersFunctionevaluateFloat
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 callersMethodlogf
(format string, v ...any)
imageproxy.go:524
↓ 7 callersFunctiontransformImage
transformImage modifies the image m based on the transformations specified in opt.
transform.go:274
↓ 6 callersMethodError
()
data.go:44
↓ 6 callersMethodWrite
(p []byte)
third_party/http/server.go:112
↓ 6 callersMethodlog
(v ...any)
imageproxy.go:516
↓ 5 callersMethodServeHTTP
ServeHTTP handles incoming requests.
imageproxy.go:200
↓ 5 callersFunctioncopyHeader
copyHeader copies values for specified headers from src to dst, adding to any existing values with the same header name.
imageproxy.go:360
↓ 5 callersFunctionhostMatches
hostMatches returns whether the host in u matches one of hosts.
imageproxy.go:424
↓ 4 callersFunctionNewRequest
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 callersFunctionParseOptions
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 callersMethodWriteHeader
(code int)
third_party/http/server.go:124
↓ 4 callersFunctionsign
(key string, s string, urlOnly bool)
cmd/imageproxy-sign/main.go:40
↓ 3 callersFunctionNewProxy
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 callersFunctionkeyToFilename
(key string)
internal/s3cache/s3cache.go:80
↓ 3 callersMethodobject
(key string)
internal/gcscache/gcscache.go:62
↓ 3 callersFunctionparseKey
(s string)
cmd/imageproxy-sign/main.go:65
↓ 3 callersFunctionpeekContentType
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 callersFunctionshould304
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 callersMethodDelete
Delete deletes the cached data at the specified key.
cache.go:16
↓ 2 callersMethodString
String returns the request URL as a string, with r.Options encoded in the URL fragment.
data.go:321
↓ 2 callersMethodallowed
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 callersFunctioncontentTypeMatches
contentTypeMatches returns whether contentType matches one of the allowed patterns.
imageproxy.go:409
↓ 2 callersFunctioncropParams
cropParams calculates crop rectangle parameters to keep it in image bounds
transform.go:174
↓ 2 callersFunctiondiskCache
(path string)
cmd/imageproxy/main.go:213
↓ 2 callersFunctiondiskCache
(path string)
caddy/module.go:158
↓ 2 callersFunctionparseURL
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 callersFunctionparseURL
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 callersFunctionreferrerMatches
returns whether the referrer from the request is in the host list.
imageproxy.go:448
↓ 2 callersFunctionresizeParams
resizeParams determines if the image needs to be resized, and if so, the dimensions to resize to.
transform.go:146
↓ 2 callersMethodtransform
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 callersFunctiontrimEdges
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 callersMethodupdateCacheHeaders
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 callersFunctionvalidSignature
validSignature returns whether the request signature is valid.
imageproxy.go:458
↓ 2 callersMethodwriteHeader
(code int)
third_party/http/server.go:133
↓ 1 callersFunctionNew
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 callersFunctionNew
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 callersFunctionParse
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 callersMethodRoundTrip
RoundTrip implements the http.RoundTripper interface.
imageproxy.go:551
↓ 1 callersMethoderrorBody
()
third_party/http/server.go:50
↓ 1 callersFunctionexifOrientation
read EXIF orientation tag from r and adjust opt to orient image correctly.
transform.go:222
↓ 1 callersFunctionkeyToFilename
(key string)
internal/gcscache/gcscache.go:67
↓ 1 callersFunctionlruCache
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 callersFunctionparseCache
parseCache parses c returns the specified Cache implementation.
cmd/imageproxy/main.go:157
↓ 1 callersFunctionparseCache
parseCache parses c returns the specified Cache implementation.
caddy/module.go:134
↓ 1 callersFunctionupdate
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
MethodCaddyModule
CaddyModule returns the Caddy module information.
caddy/module.go:49
MethodDelete
(string)
cache.go:26
MethodDelete
(key string)
internal/gcscache/gcscache.go:56
MethodDelete
(key string)
internal/s3cache/s3cache.go:67
MethodGet
(string)
cache.go:24
MethodGet
(key string)
internal/gcscache/gcscache.go:27
MethodGet
(key string)
internal/s3cache/s3cache.go:30
FunctionParseCacheControl
(headers http.Header)
third_party/httpcache/httpcache.go:11
MethodProvision
(ctx caddy.Context)
caddy/module.go:56
MethodRoundTrip
(req *http.Request)
imageproxy_test.go:343
MethodServeHTTP
(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler)
caddy/module.go:77
MethodServeHTTP
(w http.ResponseWriter, r *http.Request)
third_party/http/server.go:57
MethodSet
(string, []byte)
cache.go:25
MethodSet
(key string, value []byte)
internal/gcscache/gcscache.go:46
MethodSet
(key string, value []byte)
internal/s3cache/s3cache.go:54
MethodSet
(value string)
cmd/imageproxy/main.go:114
MethodSet
(value string)
cmd/imageproxy/main.go:140
MethodString
()
cmd/imageproxy/main.go:110
MethodString
()
third_party/httpcache/httpcache.go:29
FunctionTestAllowed
(t *testing.T)
imageproxy_test.go:95
FunctionTestContentTypeMatches
(t *testing.T)
imageproxy_test.go:762
FunctionTestCopyHeader
(t *testing.T)
imageproxy_test.go:47
FunctionTestCropParams
(t *testing.T)
transform_test.go:68
FunctionTestHostMatches
(t *testing.T)
imageproxy_test.go:176
FunctionTestNewRequest
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
FunctionTestNewRequest_BaseURL
(t *testing.T)
data_test.go:246
FunctionTestNopCache
(t *testing.T)
cache_test.go:8
FunctionTestOptions_String
(t *testing.T)
data_test.go:14
FunctionTestParseKey
(t *testing.T)
cmd/imageproxy-sign/main_test.go:60
FunctionTestParseKey_FilePath
(t *testing.T)
cmd/imageproxy-sign/main_test.go:71
FunctionTestParseOptions
(t *testing.T)
data_test.go:48
FunctionTestParseURL
(t *testing.T)
cmd/imageproxy-sign/main_test.go:95
FunctionTestPeekContentType
(t *testing.T)
imageproxy_test.go:32
FunctionTestProxy_ServeHTTP
(t *testing.T)
imageproxy_test.go:545
FunctionTestProxy_ServeHTTP_cached304
(t *testing.T)
imageproxy_test.go:603
FunctionTestProxy_ServeHTTP_is304
test that 304 Not Modified responses are returned properly.
imageproxy_test.go:583
FunctionTestProxy_ServeHTTP_maxRedirects
(t *testing.T)
imageproxy_test.go:650
FunctionTestProxy_UpdateCacheHeaders
(t *testing.T)
imageproxy_test.go:392
FunctionTestProxy_log
(t *testing.T)
imageproxy_test.go:678
FunctionTestProxy_log_default
(t *testing.T)
imageproxy_test.go:698
FunctionTestReferrerMatches
(t *testing.T)
imageproxy_test.go:206
FunctionTestResizeParams
(t *testing.T)
transform_test.go:45
FunctionTestShould304
(t *testing.T)
imageproxy_test.go:259
FunctionTestSign
(t *testing.T)
cmd/imageproxy-sign/main_test.go:15
FunctionTestSign_Errors
(t *testing.T)
cmd/imageproxy-sign/main_test.go:41
FunctionTestSign_URLOnly
(t *testing.T)
cmd/imageproxy-sign/main_test.go:28
FunctionTestTranform_ImageTooLarge
(t *testing.T)
transform_test.go:145
next →1–100 of 116, ranked by callers