Liking cljdoc? Tell your friends :D

imagine.core


cached?clj

(cached? spec)

Given a spec, returns true if the image/transformation combo is cached on disk, false otherwise.

Given a spec, returns `true` if the image/transformation combo is
cached on disk, `false` otherwise.
sourceraw docstring

content-hashclj

(content-hash file-path
              transform
              {:keys [transformations cacheable-urls? resource-path]})

Compute a hash of the contents. If the configuration key :cacheable-urls? is false, the hash will be faster, but less accurate, as it will only use the file path and mtime, and not the actual file contents for the hash, along with the transformation configuration. Always set :cacheable-urls? to true in production environments.

Compute a hash of the contents. If the configuration key `:cacheable-urls?` is
`false`, the hash will be faster, but less accurate, as it will only use the
file path and mtime, and not the actual file contents for the hash, along with
the transformation configuration. Always set `:cacheable-urls?` to `true` in
production environments.
sourceraw docstring

crop-paramsclj

(crop-params image opt)
source

default-tmpdirclj

source

ensure-rgbclj

(ensure-rgb image)
source

fit-crop-paramsclj

(fit-crop-params image {:keys [width height offset-y offset-x]})
source

fit-resize-paramsclj

(fit-resize-params image {:keys [width height scale-up?]})
source

formatterclj

source

get-image-from-urlclj

(get-image-from-url config url)
source

get-transformed-imageclj

(get-transformed-image spec config)
source

image-specclj

(image-spec url)

Parses the image URL to a map describing the desired file, output format and transformation.

Parses the image URL to a map describing the desired file, output
format and transformation.
sourceraw docstring

image-url?clj

(image-url? url {:keys [prefix]})

Returns true if the URL is a request for a transformed image - e.g., starts with the configured prefix.

Returns true if the URL is a request for a transformed image - e.g.,
starts with the configured prefix.
sourceraw docstring

inflate-specclj

(inflate-spec spec config)

Given a spec from image-spec and a config map, validate and inflate the spec so it includes all details necessary to perform the transformation.

Given a spec from `image-spec` and a config map, validate and inflate
the spec so it includes all details necessary to perform the
transformation.
sourceraw docstring

last-modifiedclj

(last-modified file)
source

path-reclj

source

realize-urlclj

(realize-url config url)

Given an an URL that contains only a transformation and a file name, use the configuration to fully qualify it with a prefix and content hash.

Given an an URL that contains only a transformation and a file name,
use the configuration to fully qualify it with a prefix and content
hash.
sourceraw docstring

resize-paramsclj

(resize-params image opt)
source

serve-imageclj

(serve-image req config)

Prepare a Ring response for the image described by the request. Optionally caches the file on disk for better future performance.

Prepare a Ring response for the image described by the request.
Optionally caches the file on disk for better future performance.
sourceraw docstring

transformcljmultimethod

source

transform-imageclj

(transform-image transformation-config)

Transforms an image according to the transformation specs and returns a BufferedImage.

Transforms an image according to the transformation specs and returns
a `BufferedImage`.
sourceraw docstring

transform-image-to-fileclj

(transform-image-to-file transformation file-path)
source

url-toclj

(url-to config transform file-path)

Given a config map, a keyword transform to apply, and the path to a file, return a URL that the middleware will recognize and process.

Given a config map, a keyword transform to apply, and the path to a
file, return a URL that the middleware will recognize and process.
sourceraw docstring

validate-transformation-image-sizeclj

(validate-transformation-image-size image {:keys [transformations]})
source

wrap-imagesclj

(wrap-images handler & [config])

Ring middleware - intercept any request to the configured prefix, and serve transformed images from it.

Ring middleware - intercept any request to the configured prefix, and
serve transformed images from it.
sourceraw docstring

write-imageclj

(write-image image
             {:keys [ext quality progressive? width height transformations]
              :as spec}
             file-path)

Writes image with the specified quality parameters to file-path. Creates necessary parent directories.

Writes `image` with the specified quality parameters to `file-path`.
Creates necessary parent directories.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close