At 19:47 02.06.00 +0800, James Henstridge wrote:
>On Wed, 31 May 2000, Hans Breuer wrote:
>
>> plug-ins/wpg/wpg.c - WordPerfect Graphics Metafile Export.
>>   This export filter generates WPG 1.0 [...]
>> It would be nice if someone could compile and test the first two
>> filters on Linux.
>
>I am still looking through the plug-ins, but I can see one obvious problem
>in the WPG one.  Under most unix C compilers, structure members are
>aligned, so the WPGHead32 structure will not be the same size all the
>time:
>  typedef struct {
>    guint8 Type;
>    guint8 Dummy;
>    guint32 Size;
>  } WPGHead32;
>
>at least under linux, an extra 2 bytes of padding will go in between the
>Dummy and Size members.  This means that you can't just write the
>structure to the file directly.  I guess this wasn't a problem under
>win32, as it doesn't align structure members.
>

There is structure packaging with M$VC as well and there is the 
#pragma pack directive to fix or produce problems with it.

The main reason it appears to work here: it wasn't used, because it's
only needed for single objects with size > 32767 (My test bitmaps
were smaller). 
I'm still investigating a related documentation problem. There seems 
to be no way to detect if a WPGHead16 or WPGHead32 was used, while 
reading a wpg file. Maybe the 32 bit version was never used.

        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert

Reply via email to