bhurlow / ring-image-crop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ring-image-crop

ring middleware that auto crops and serves urls according the width and height query params

Usage

in your project.clj:

[ring-image-crop "0.0.1"]

Then install the handler. (note that the params and keyword-params are required)

(def app
  (-> handler
      (wrap-file "public")
      (wrap-image-crop "public")
      (wrap-keyword-params)
      (wrap-params)))
;; first requests would crop if crop not already made
(get "/kitten.png?width=100&height=10")

;; subsequent reqs return cropped version
(get "/kitten.png?width=100&height=10")

About

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%