Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!uw-beaver!cornell!rochester!PT.CS.CMU.EDU!ZOG.CS.CMU.EDU!tgl From: tgl@ZOG.CS.CMU.EDU (Tom Lane) Newsgroups: comp.sys.mac.programmer Subject: How to cope with PackBits bug? Message-ID: <1170@PT.CS.CMU.EDU> Date: 19 Mar 88 04:48:09 GMT Sender: netnews@PT.CS.CMU.EDU Reply-To: tgl@zog.cs.cmu.edu (Tom Lane) Distribution: na Organization: Carnegie-Mellon University, CS/RI Lines: 21 Keywords: PackBits QuickDraw Well, it's not really a bug, because Inside Macintosh sez that you can't apply PackBits to an input string of more than 127 bytes. (If it's documented it's not a bug, right? B******t.) Anyway, if you pass PackBits a string of more than 128 identical bytes, it silently produces incorrect output, because it doesn't bother to check for overflow of a byte-wide repeat count in its output. I ran into this while trying to make SoftStyle's HP LaserJet printer driver work with HyperCard. HC likes to output bitmaps that are wider than 1024 pixels (=128 bytes); SoftStyle's driver tries to put said bitmaps into QuickDraw picture objects for spooling. QuickDraw insists on packing bitmaps before stuffing them into picture objects ... soon as it hits an all-zero row in the bitmap, we got trouble in River City. Any recommendations on a workaround? The only obvious solution involves duplicating and patching a rather large chunk of the Mac ROM code... -- tom lane ARPA: tgl@zog.cs.cmu.edu UUCP: !zog.cs.cmu.edu!tgl BITNET: tgl%zog.cs.cmu.edu@cmuccvma