[comp.windows.x] Possible bug in CLX's put-raw-image?

foonberg@aerospace.aero.org (Alan Foonberg) (04/07/88)

--------

I'm running CLX Release 2 on a SUN 3/160C with 16 Meg of memory,
under Sun UNIX 4.2 Release 3.2.

I am able to create a somewhat large pixmap and associated
raw image by using create-pixmap and get-raw-image.  What
results is a long array containing the bytes of the image.
I then write these bytes to a file.

In another program, I read the file into an array, create
a pixmap, and try to put-raw-image the array onto the pixmap.
This fails for larger images.  I have tried this using the Sun
both as a monochrome device and a color device, and both fail.
However, when I have pixmaps of depth 8, the area of the biggest
pixmap I can put-raw-image onto is smaller than when I have
pixmaps of depth 1.  The limiting factor seems to be the length
of the array used by get-raw-image and put-raw-image.

The largest array that has worked for me is 129,240 bytes long.
The smallest array that hasn't worked is 132,112 bytes long.
It may be a coincidence, but 2^17 is 131,072, which is suspiciously
in between my two limiting cases.

It is always put-raw-image that fails.  The immediate error message
I get is:

>>Error: couldn't write buffer to file #P"Unknown_file" at position
98455, broken pipe

XLIB::BUFFER-WRITE-DEFAULT:
   Required arg 0 (VECTOR): #<Simple-Vector (UNSIGNED-BYTE 8) 4096 C08E93>
   Required arg 1 (DISPLAY): #<DISPLAY basil 0>
   Required arg 2 (START): 0
   Required arg 3 (END): 4096

As I control-n up the stack, the routines called along the way are
XLIB::BUFFER-WRITE, XLIB::BUFFER-FLUSH, XLIB::WRITE-VECTOR-CARD8,
and PUT-RAW-IMAGE.

The DATA argument to WRITE-VECTOR-CARD8 is #<Simple-Vector T 132112 C10F83>,
BOFFSET is 132, START is 0, END is 132112.

The DATA argument to PUT-RAW-IMAGE is #<Simple-Vector T 132112 C10F83>,
START is 0, DEPTH is 1, X and Y are 0, WIDTH is 1441, HEIGHT is 718,
LEFT-PAD is 0, and FORMAT is :Z-PIXMAP.


I would appreciate any help anyone could offer.

Thanks,  

Alan Foonberg
The Aerospace Corporation
foonberg@aerospace.aero.org