Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdint committed Oct 14, 2016
1 parent 3a66954 commit fa6fddf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frog/responsive-images.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@
(require rackunit))

(define (image-width path)
(string->number
(with-output-to-string
(λ ()
(eprintf "identify=~a path=~a\n" identify path)
(system* identify "-format" "%w" path)))
))
(eprintf "identify=~a path=~a\n" identify path)
(let ([str (with-output-to-string
(λ ()
(system* identify "-format" "%w" path)))])
(printf "str=~a" str)
(let ([n (string->number str)])
(printf " n=~a\n" n)
n)))

(module+ test
(when magick-available?
(displayln "identify:")
(system* identify "-version")
(parameterize ([top example])
(check-eq? (image-width (build-path (www/img-path) "800px-image.gif")) 800))))

Expand Down

0 comments on commit fa6fddf

Please sign in to comment.