aboutsummaryrefslogtreecommitdiff
path: root/scheme/idest/format
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2015-11-05 23:20:23 +0200
committerSergey Poznyakoff <gray@gnu.org>2015-11-05 23:20:23 +0200
commit6f8dc538dab2a9284802b63e80fd4f03bb0dff34 (patch)
tree387372a6dc1c8e04aa81e19b19820c8d75351f67 /scheme/idest/format
parent353839b7a29a53aa754b98b02ede449c737a873a (diff)
downloadidest-6f8dc538dab2a9284802b63e80fd4f03bb0dff34.tar.gz
idest-6f8dc538dab2a9284802b63e80fd4f03bb0dff34.tar.bz2
Bugfixes.
1. Fix --convert option so it can be used to remove unnecessary ID3 formats (e.g. --convert=2). 2. Fix processing of unknown frames in Guile code. 3. Fix setpic and pic modules. * scheme/idest/batch/setpic.scm (read-picture): Use binary i/o. * scheme/idest/format/pic.scm (save-picture): Likewise. * scheme/idest/list-modules.scm: Minor changes. * src/frametab.gperf (frame_field_from_rawdata): New function. * src/getopt.m4: Update copyright years. * src/guile.c (set_frame_from_rawdata): Use frame_field_from_rawdata. * src/idest.h (frame_field_from_rawdata): New proto. * src/idop.c (set_tag_options): Always call id3_tag_options.
Diffstat (limited to 'scheme/idest/format')
-rw-r--r--scheme/idest/format/pic.scm27
1 files changed, 22 insertions, 5 deletions
diff --git a/scheme/idest/format/pic.scm b/scheme/idest/format/pic.scm
index 0e42f25..5e831fb 100644
--- a/scheme/idest/format/pic.scm
+++ b/scheme/idest/format/pic.scm
@@ -1,5 +1,5 @@
;; This file is part of Idest
-;; Copyright (C) 2011 Sergey Poznyakoff
+;; Copyright (C) 2011, 2015 Sergey Poznyakoff
;;
;; Idest is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
(define-module (idest format pic))
(use-modules (ice-9 getopt-long)
+ (rnrs io ports)
(srfi srfi-1))
(define-public description
@@ -72,11 +73,28 @@
segments))))
(define (save-picture name data)
+ (let ((port (open-file-output-port name)))
+ (for-each
+ (lambda (c) (put-u8 port c))
+ (let string->bytelist ((str data)
+ (bytelist '()))
+ (cond
+ ((string-null? str)
+ (reverse bytelist))
+ (else
+ (string->bytelist
+ (substring str 2)
+ (cons
+ (string->number (substring str 0 2) 16)
+ bytelist))))))
+ (close-port port)))
+
+(define (save-picture-0 name data)
(with-output-to-file
name
(lambda ()
(for-each
- write-char
+ (lambda (c) (put-u8 (current-output-port) c))
(let string->bytelist ((str data)
(bytelist '()))
(cond
@@ -86,8 +104,7 @@
(string->bytelist
(substring str 2)
(cons
- (integer->char
- (string->number (substring str 0 2) 16))
+ (string->number (substring str 0 2) 16)
bytelist)))))))))
(define-public (idest-init)
@@ -204,4 +221,4 @@
(exit 1)))))))
pictures))))))))
- \ No newline at end of file
+

Return to:

Send suggestions and report system problems to the System administrator.