Comment image improvements

* make QR image larger
* use status logo
* layout tweaks
This commit is contained in:
Teemu Patja 2017-10-27 13:22:35 +03:00
parent 6f2cb1c2a5
commit 967778a761
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
2 changed files with 14 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@
[address]
(qr/as-input-stream
(qr/from (str "ethereum:" address)
:size [255 255])))
:size [384 384])))
(defn token-map->list [tokens]
@ -32,7 +32,9 @@
tokens)))
(defn image-height [tokens]
(+ 300 (* 32 (count (keys tokens)))))
(let [n-tokens (count (keys tokens))]
(+ 355 (if (< n-tokens 2) 0
(* 32 (- n-tokens 1))))))
(defn gen-comment-image [address balance-eth tokens issue-url]
(let [qr-image (String. (image->base64 (generate-qr-image address))
@ -74,4 +76,7 @@
(comment
(with-open [w (io/output-stream "foo.png")]
(.write w (gen-comment-image "0xf00barbeeff00barbeeff00barbeeff00barbeef" "12.2" {:SNT 250.2000000343 :GNO 100 :WTF 3452.42} "http://github.com/someorg/somerepo/issues/42"))))
(.write w (gen-comment-image "0xf00barbeeff00barbeeff00barbeeff00barbeef" "12.2" {:SNT 250.2000000343
:GNO 100
:WTF 3452.42
} "http://github.com/someorg/somerepo/issues/42"))))