summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2020-07-26 17:02:33 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2020-07-26 17:02:33 +0200
commit7169de11db036b4da45a8b7160134637043126d9 (patch)
tree2b9877044f31d031f0d28cf75e1a1784ee38f3d2 /utils
parent611af200936a56d2c8ce3af95001615303f49d24 (diff)
Update isbn creation from dashed ISBN
Diffstat (limited to 'utils')
-rw-r--r--utils/cover/barcode.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/cover/barcode.scm b/utils/cover/barcode.scm
index b016e27..b178703 100644
--- a/utils/cover/barcode.scm
+++ b/utils/cover/barcode.scm
@@ -1,4 +1,5 @@
(import (chibi)
+ (chibi string)
(chibi sxml)
(srfi 1))
@@ -50,7 +51,7 @@
(E L G G L G L S R R R R R R E)))
(define (barcode number)
- "Get number in decima string"
+ "Get number in decimal string"
(let* ((nums (string->list number))
(digits (map (lambda (x) (string->number (list->string (list x))))
@@ -71,6 +72,8 @@
sep))))))
+(define (remove-dashes code)
+ (string-join (string-split code #\-) ""))
(define (barcode-sxml code x y scale)
@@ -84,7 +87,8 @@
(number->string width)
" "
(number->string height)))
- (encoded (barcode code)))
+ (code (remove-dashes code))
+ (encoded (barcode code)))
`(g
(@ (transform ,(string-append "translate(" (number->string x) ","
(number->string y) ")"