[racket] Racket 5.1: "bitmap scheme-box.jpg failed to load" error

From: Karn Kallio (tierpluspluslists at gmail.com)
Date: Wed Feb 16 01:38:53 EST 2011

> At Tue, 15 Feb 2011 22:33:06 -0430, Karn Kallio wrote:
> > I came across the same thing ... it must be libjpeg 6.2 (you can see this
> > in the file collects/racket/draw/unsafe/jpeg.rkt
> In the call
>   (ffi-lib "libjpeg" '("62" ""))
> '("62" "") requests version 6.2, but it settles for a versionless
> library (which is typically linked to some specific version). The hack
> at the definition of JPEG_LIB_VERSION determines which version was
> actually loaded.
> So, installing version 6.2 may avoid the problem, but I'm interested to
> understand why version 8.3 didn't work out.

With version 80 the following error appears

 (read-bitmap "scheme-box.jpg")
. . jpeg: JPEG parameter struct mismatch: library thinks size is 656, caller 
expects 680

and with version 62 the same is error-free.

It looks like some of the structs have changed between the versions of 
libjpeg, for example in version 80 the struct jpeg_decompress_struct has a 
field is_baseline which does not seem to be represented in the jpeg.rkt file.

I have attached the jpeglib.h version 80 which I have handy.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jpeglib.h
Type: text/x-chdr
Size: 48475 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110216/d9e7fd72/attachment.bin>

Posted on the users mailing list.