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

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 16 09:40:13 EST 2011

At Wed, 16 Feb 2011 02:08:53 -0430, Karn Kallio wrote:
> 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.

The `is_baseline' field is absorbed into the `comp_info&is_baseline'
field. That field has the version-specific `_comp_info_size' type,
which either includes `is_baseline' or not, depending on the jpeglib

The problem is those version-specific field types do not get the right
field alignment for x86_64, and so the overall size of the structure
changes. (The alignment works out ok for 32-bit platforms, which is
where I had tried it before.)

For the next version, I've changed the way that the jpeg structures are
defined. The new approach avoids alignment problems when adapting to
the library version.

Meanwhile, for version 5.1 on 64-bit platforms, the simplest workaround
is still to install libjpeg 6.2.

Thanks for the report and help tracking down the problem!

Posted on the users mailing list.