[racket] the program can't find image file

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Oct 10 09:55:21 EDT 2010

Thanks for sending the whole program. I would say that the original
problem from the beginning of this thread is probably best considered
a bug in 'bitmap'.

Noel's code is how I would work around it, but I would do this instead:

 (define-runtime-path img-fn "programming/dct/cauliflower.jpg")

 (define cauliflower
  (make-object image-snip%
    (make-object bitmap% img-fn)))

Otherwise, the binary building code will pull in everything in the
current directory (and in all subdirectories).


On Sun, Oct 10, 2010 at 6:17 AM, Noel Welsh <noelwelsh at gmail.com> wrote:
> Here is a working solution, where I have replaced the hero with a
> picture I had on my hard disk:
> #lang racket
> (require 2htdp/universe)
> (require 2htdp/image)
> (require racket/gui/base)
> (require racket/runtime-path)
> (define-runtime-path here ".")
> (define cauliflower
>  (make-object image-snip%
>    (make-object bitmap% (build-path here "programming/dct/cauliflower.jpg"))))
> The root of the problem is that bitmap in 2htdp/image only allows you
> to search in a few restricted paths. This seems a pretty silly
> restriction. To work around it we had to implement what bitmap does
> ourselves. Luckily this isn't hard.
> N.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.