improved the error message for save-image
closes PR 11076
This commit is contained in:
parent
32f1f1d8f1
commit
f1e38247e0
|
@ -57,9 +57,8 @@
|
|||
[parent bp]) min-width 100)
|
||||
(send f show #t)))
|
||||
|
||||
(define (save-image pre-image filename)
|
||||
(let* ([image (to-img pre-image)]
|
||||
[bm (make-object bitmap%
|
||||
(define/chk (save-image image filename)
|
||||
(let* ([bm (make-object bitmap%
|
||||
(inexact->exact (ceiling (+ 1 (get-right image))))
|
||||
(inexact->exact (ceiling (+ 1 (get-bottom image)))))]
|
||||
[bdc (make-object bitmap-dc% bm)])
|
||||
|
|
|
@ -1532,7 +1532,8 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; test that the extra mode check is there
|
||||
;; test errors.
|
||||
;; mostly test that the extra mode check is there
|
||||
;;
|
||||
|
||||
(test/exn (rectangle 10 10 "solid" (make-pen "black" 12 "solid" "round" "round"))
|
||||
|
@ -1588,6 +1589,9 @@
|
|||
=>
|
||||
#rx"^polygon: expected <image-color>")
|
||||
|
||||
(test/exn (save-image "tri.png" (triangle 50 "solid" "purple"))
|
||||
=>
|
||||
#rx"^save-image:")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue
Block a user