Comment image improvements
* make QR image larger * use status logo * layout tweaks
This commit is contained in:
parent
6f2cb1c2a5
commit
967778a761
File diff suppressed because one or more lines are too long
|
@ -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"))))
|
||||
|
|
Loading…
Reference in New Issue