diff --git a/src/clj/yenu/helpers/images.clj b/src/clj/yenu/helpers/images.clj index 7c24855..1bd94bc 100644 --- a/src/clj/yenu/helpers/images.clj +++ b/src/clj/yenu/helpers/images.clj @@ -48,7 +48,10 @@ (crop-from resized-img crop-margin 0 width width))))) (defn scale-normal [width height] - (resize-fn width height ultra-quality)) + #(let [image-file % [orig-width orig-height] (dimensions (utils/buffered-image image-file))] + (if (and (< orig-width width) (< orig-height height)) + ((resize-fn orig-width orig-height ultra-quality) %) + ((resize-fn width height ultra-quality) %)))) (defn remove-metadata [filepath file] (if (contains? #{".jpg" ".jpeg" ".jpe"} (s/lower-case (fs/extension filepath)))