GraphicsMagick: magick/wpg.c: ObjectID>=0x8000 automatically swi...
GraphicsMagick Commits <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.cvs |
|---|---|
| Message-ID | <mailman.51256.1635066988.14225.graphicsmagick-commit@lists.sourceforge.net> |
changeset 4108ca3ae470 in /hg/GraphicsMagick details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=4108ca3ae470 summary: magick/wpg.c: ObjectID>=0x8000 automatically switches double precision on. diffstat: ChangeLog | 4 ++++ coders/wpg.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diffs (42 lines): diff -r 3d657485eadf -r 4108ca3ae470 ChangeLog --- a/ChangeLog Sat Sep 18 09:52:31 2021 -0500 +++ b/ChangeLog Sun Oct 24 11:15:51 2021 +0200 @@ -1,3 +1,7 @@ +2019-10-24 Fojtik Jaroslav <[email protected]> + + * magick/wpg.c: ObjectID>=0x8000 automatically switches double precision on. + 2021-09-18 Fojtik Jaroslav <[email protected]> * PerlMagick/t/wmf/JPGinside.emf: Add test file: EMF that embedds diff -r 3d657485eadf -r 4108ca3ae470 coders/wpg.c --- a/coders/wpg.c Sat Sep 18 09:52:31 2021 -0500 +++ b/coders/wpg.c Sun Oct 24 11:15:51 2021 +0200 @@ -744,7 +744,7 @@ typedef float tCTM[3][3]; -static unsigned LoadWPG2Flags(Image *image,char Precision,float *Angle,tCTM *CTM) +static unsigned LoadWPG2Flags(Image *image, char Precision, float *Angle, tCTM *CTM) { const unsigned char TPR=1,TRN=2,SKW=4,SCL=8,ROT=0x10,OID=0x20,LCK=0x80; long x; @@ -761,9 +761,16 @@ if(Flags & OID) { if(Precision==0) - {/*x=*/ (void) ReadBlobLSBShort(image);} /*ObjectID*/ + {x = ReadBlobLSBShort(image); + if(x >= 0x8000) + { + Precision = 1; // Double precision Switched on. + (void)ReadBlobLSBShort(image); + //ObjectId = ((xW & 0x7FFF)<<16) | DenX; + } + } /*ObjectID*/ else - {/*x=*/ (void) ReadBlobLSBLong(image);} /*ObjectID (Double precision)*/ + {/*x=*/ (void) ReadBlobLSBLong(image);} /*ObjectID native (Double precision)*/ } if(Flags & ROT) {