diff --git a/src/clj/yenu/helpers/images.clj b/src/clj/yenu/helpers/images.clj index fe7db59..d8e18cd 100644 --- a/src/clj/yenu/helpers/images.clj +++ b/src/clj/yenu/helpers/images.clj @@ -3,6 +3,8 @@ [image-resizer.util :as utils] [image-resizer.format :refer :all] [image-resizer.crop :refer :all] + [image-resizer.resize :refer :all] + [image-resizer.scale-methods :refer :all] [clojure.java.io :as io] [digest :as digest] [me.raynes.fs :as fs] @@ -35,17 +37,17 @@ (defn scale-thumbnail [width] #(let [image-file % [orig-width orig-height] (dimensions (utils/buffered-image image-file))] (if (< orig-width orig-height) - (let [resized-img (resize-to-width image-file width) + (let [resized-img ((resize-width-fn width ultra-quality) image-file) [w h] (dimensions resized-img) crop-margin (quot (- h width) 2)] (crop-from resized-img 0 crop-margin width width)) - (let [resized-img (resize-to-height image-file width) + (let [resized-img ((resize-height-fn width ultra-quality) image-file) [w h] (dimensions resized-img) crop-margin (quot (- w width) 2)] (crop-from resized-img crop-margin 0 width width))))) (defn scale-normal [width height] - #(resize % width height)) + (resize-fn width height ultra-quality)) (defn save [fn params filepath target-filepath] (let [file (exif/without-exif (io/file filepath))]