[Image-SIG] PIL buglet?

Perry Stoll pas@scansoft.com
Wed, 29 Sep 1999 14:04:37 -0400 (EDT)


On Wed, 29 Sep 1999, Fredrik Lundh wrote:

    (it's wednesday! pil support day!)
    
    Georg Mischler <schorsch@schorsch.com> wrote:
    > In Imaging.h, the ImagingMemoryInstance is defined as:
    > 
    > struct ImagingMemoryInstance {
    > 
    >     /* Format */
    >     char mode[4+1]; /* Band names ("1", "L", "P", "RGB", "RGBA", "CMYK") */
    >     int type; /* Data type */
    >     int depth; /* Depth (ignored in this version) */
    >     int bands; 
    > ...
    > 
    > This allows for mode designators up to 4 characters in length.
    > Unfortunately, some of the modes implemented in Storage.c
    > have names of up to 6 characters, which may (or may not,
    > depending on your compiler) overwrite the type member.
    
    oops.
    
    luckily, it's "may not" on every modern platform
    (up to seven characters is ok, thanks to integer
    padding).

Grrr...that's completely compiler dependent, e.g. MSVC has a switch to
modify the default padding size, which is a (moderately) reasonable thing
to do.

    I 'm very reluctant to change
    the instance layout before the next major release,
    so I guess we have to live with this buglet a while.
    it shouldn't affect anything, as far as I can tell.

Can you explain why you are reluctant to change something that is
obviously broken and dangerous, and is going to cause mysterious and hard
to trace errors? There are enough undiscovered bug's out there - let's
squash the ones we can.

Going back to debugging some code of my own,

  -Perry