diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2020-07-12 22:37:35 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2020-07-12 22:37:35 +0900 |
commit | 90206f5a2305be1b5b9b907b15ac58bdd1a4e44c (patch) | |
tree | 3974cd9efcf8ab688fb524f2b43a294cce40529d /qkbox | |
parent | 4ba66148210a9d354c733cb0f1fc87a0c0d37c22 (diff) |
qkbox: toot: Fix fetch-pict procedure.
Diffstat (limited to 'qkbox')
-rw-r--r-- | qkbox/toot.scm | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/qkbox/toot.scm b/qkbox/toot.scm index 3881934..e4314bd 100644 --- a/qkbox/toot.scm +++ b/qkbox/toot.scm @@ -378,29 +378,29 @@ (define* (fetch-pict url #:key resize height>) (receive (res body) (http-get url) - (let ((tmp (tmpnam))) - (let ((in (open tmp (logior O_WRONLY O_CREAT O_EXCL)))) - (put-bytevector in body) - (close in)) - (case (response-code res) - ((200) - (let ((pict (and (zero? (apply system* "convert" - `(,@(and/nil resize - `("-resize" - ,(format #f "~dx~d!" - (car resize) - (cadr resize)))) - ,@(and/nil height> - `("-resize" - ,(format #f "x~d>" - height>))) - ,(string-append tmp "[0]") - ,(string-append "png:" tmp)))) - (pict-from-file tmp)))) + (case (response-code res) + ((200) + (let ((tmp (tmpnam))) + (let ((in (open tmp (logior O_WRONLY O_CREAT O_EXCL)))) + (put-bytevector in body) + (close in)) + (let ((pict + (and (zero? (apply system* "convert" + `(,@(and/nil resize + `("-resize" + ,(format #f "~dx~d!" + (car resize) + (cadr resize)))) + ,@(and/nil height> + `("-resize" + ,(format #f "x~d>" + height>))) + ,(string-append tmp "[0]") + ,(string-append "png:" tmp)))) + (pict-from-file tmp)))) (delete-file tmp) - pict)) - (else - #f))))) + pict))) + (else #f)))) (define* (fetch-avatar-static url) (cond |