Don't scale small images #14

This commit is contained in:
Aaron Fischer 2017-05-03 23:17:47 +02:00
parent 34d724292b
commit 68ee12d2cf

View file

@ -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)))