Commit 66a91477 authored by Ricardo J. Mendez's avatar Ricardo J. Mendez

New icon, planck script for easy regeneration

parent 36a65d19
#!/usr/local/bin/planck
(ns booklet.generate-icons
(:require [planck.core :refer [exit *command-line-args*]]
[planck.shell :refer [sh]]))
(defn ensure-succeeded! [x]
(print (:out x))
(when-not (zero? (:exit x))
(println "Non-zero exit code!")
(print (:err x))
(exit (:exit x))))
(defn do! [& args]
(ensure-succeeded! (apply sh args)))
(def path "resources/images/")
(def sizes [16 19 38 48 128])
; TODO: Once we get planck 1.6, add command line args so that we can do either
; release or start
; (do! "git" "flow" "release" "start" timestamp)
(defn do-resize! [filename]
(doseq [size sizes]
(let [origin (str path filename)
target (str path "icon" size ".png")]
(println "Converting" origin "to" target)
(do! "convert" origin "-resize" (str size "x" size) target)
)))
(let [filename (first *command-line-args*)]
(if (empty? filename)
(println "Need a file name for the image to proceed. Aborting.")
(do-resize! filename)))
(println "Done")
\ No newline at end of file
resources/images/icon128.png

2.38 KB | W: | H:

resources/images/icon128.png

8.33 KB | W: | H:

resources/images/icon128.png
resources/images/icon128.png
resources/images/icon128.png
resources/images/icon128.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/icon16.png

350 Bytes | W: | H:

resources/images/icon16.png

1.24 KB | W: | H:

resources/images/icon16.png
resources/images/icon16.png
resources/images/icon16.png
resources/images/icon16.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/icon19.png

374 Bytes | W: | H:

resources/images/icon19.png

1.04 KB | W: | H:

resources/images/icon19.png
resources/images/icon19.png
resources/images/icon19.png
resources/images/icon19.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/icon38.png

780 Bytes | W: | H:

resources/images/icon38.png

2.18 KB | W: | H:

resources/images/icon38.png
resources/images/icon38.png
resources/images/icon38.png
resources/images/icon38.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/icon48.png

1 KB | W: | H:

resources/images/icon48.png

2.81 KB | W: | H:

resources/images/icon48.png
resources/images/icon48.png
resources/images/icon48.png
resources/images/icon48.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment