Article View: comp.lang.postscript
Article #4337Re: readhexstring problem
From: Rich Gopstein
Date: Fri, 28 Dec 1990 18:13
Date: Fri, 28 Dec 1990 18:13
39 lines
1845 bytes
1845 bytes
In article <3390@gazette.bcm.tmc.edu> rdargahi@meyerhof.iaims.bcm.tmc.edu (Ross Dargahi) writes:
>
>/picstr 1 string def
>
>12 12 1 [12 0 0 12 0 12] {currentfile picstr readhexstring pop} image
><image data here>
>
>when i use the above code the image is rendered correctly, but if I change the
>length of picstr to anything other than one (I tried several values)
>the code ceases to work, what am I doing wrong? what values could
>I use for the length of picstr?
>
Image calls readhexstring repeatedly until it has enough data for the
image. Readhexstring reads data into picstr skipping over bogus
characters until picstr is full. The problem occurs when the number
of bytes required to describe the image (keeping in mind that each
row must start on a byte boundary), is not an even multiple of
the length of picstr.
If the image size is not a multiple of picstr's length, the last call
to readhexstring will grab some or all of the command after the image
data (usually showpage).
It turns out that the line length of the image data in the file is
not important since readhexstring skips over line breaks. It also
doesn't matter what the width in pixels of the image is, since
image doesn't care if a new scan line starts in the middle of
a picstr.
--
Rich Gopstein
gopstein@squibb.com
rutgers!squibb.com!gopstein
Technical Details
Message-ID:
<1127@soleil.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!rutgers!soleil!helix!gopsteinReferences:
<3390@gazette.bcm.tmc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!rutgers!soleil!helix!gopstein From: gopstein@helix.squibb.com (Rich Gopstein) Newsgroups: comp.lang.postscript Subject: Re: readhexstring problem Message-ID: <1127@soleil.UUCP> Date: 28 Dec 90 18:13:11 GMT References: <3390@gazette.bcm.tmc.edu> Sender: news@soleil.UUCP Reply-To: gopstein@helix.squibb.com (Rich Gopstein) Organization: Bristol-Myers Squibb PRI, Lawrenceville, NJ Lines: 39