]>
git.ipfire.org Git - thirdparty/cups.git/blob - filter/imagetops.c
2 * "$Id: imagetops.c 5379 2006-04-07 13:48:37Z mike $"
4 * Image file to PostScript filter for the Common UNIX Printing System (CUPS).
6 * Copyright 1993-2006 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
28 * main() - Main entry...
29 * ps_hex() - Print binary data as a series of hexadecimal numbers.
30 * ps_ascii85() - Print binary data as a series of base-85 numbers.
34 * Include necessary headers...
46 int Flip
= 0, /* Flip/mirror pages */
47 XPosition
= 0, /* Horizontal position on page */
48 YPosition
= 0, /* Vertical position on page */
49 Collate
= 0, /* Collate copies? */
50 Copies
= 1; /* Number of copies */
57 static void ps_hex(cups_ib_t
*, int, int);
58 static void ps_ascii85(cups_ib_t
*, int, int);
62 * 'main()' - Main entry...
65 int /* O - Exit status */
66 main(int argc
, /* I - Number of command-line arguments */
67 char *argv
[]) /* I - Command-line arguments */
69 cups_image_t
*img
; /* Image to print */
70 float xprint
, /* Printable area */
72 xinches
, /* Total size in inches */
74 float xsize
, /* Total size in points */
78 float aspect
; /* Aspect ratio */
79 int xpages
, /* # x pages */
80 ypages
, /* # y pages */
81 xpage
, /* Current x page */
82 ypage
, /* Current y page */
83 page
; /* Current page number */
84 int xc0
, yc0
, /* Corners of the page in image coords */
86 cups_ib_t
*row
; /* Current row */
87 int y
; /* Current Y coordinate in image */
88 int colorspace
; /* Output colorspace */
89 int out_offset
, /* Offset into output buffer */
90 out_length
; /* Length of output buffer */
91 ppd_file_t
*ppd
; /* PPD file */
92 ppd_choice_t
*choice
; /* PPD option choice */
93 int num_options
; /* Number of print options */
94 cups_option_t
*options
; /* Print options */
95 const char *val
; /* Option value */
96 int slowcollate
; /* Collate copies the slow way */
97 float g
; /* Gamma correction value */
98 float b
; /* Brightness factor */
99 float zoom
; /* Zoom facter */
100 int xppi
, yppi
; /* Pixels-per-inch */
101 int hue
, sat
; /* Hue and saturation adjustment */
102 int realcopies
, /* Real copies being printed */
103 emit_jcl
; /* Emit JCL? */
104 float left
, top
; /* Left and top of image */
105 char filename
[1024]; /* Name of file to print */
106 time_t curtime
; /* Current time */
107 struct tm
*curtm
; /* Current date */
108 char curdate
[255]; /* Current date string */
112 * Make sure status messages are not buffered...
115 setbuf(stderr
, NULL
);
118 * Check command-line...
121 if (argc
< 6 || argc
> 7)
123 fputs("ERROR: imagetops job-id user title copies options [file]\n", stderr
);
127 fprintf(stderr
, "INFO: %s %s %s %s %s %s %s\n", argv
[0], argv
[1], argv
[2],
128 argv
[3], argv
[4], argv
[5], argv
[6] ? argv
[6] : "(null)");
131 * Copy stdin as needed...
136 int fd
; /* File to write to */
137 char buffer
[8192]; /* Buffer to read into */
138 int bytes
; /* # of bytes to read */
141 if ((fd
= cupsTempFd(filename
, sizeof(filename
))) < 0)
143 perror("ERROR: Unable to copy image file");
147 fprintf(stderr
, "DEBUG: imagetoraster - copying to temp print file \"%s\"\n",
150 while ((bytes
= fread(buffer
, 1, sizeof(buffer
), stdin
)) > 0)
151 write(fd
, buffer
, bytes
);
156 strlcpy(filename
, argv
[6], sizeof(filename
));
159 * Process command-line options and write the prolog...
170 Copies
= atoi(argv
[4]);
173 num_options
= cupsParseOptions(argv
[5], 0, &options
);
175 ppd
= SetCommonOptions(num_options
, options
, 0);
177 if ((val
= cupsGetOption("multiple-document-handling", num_options
, options
)) != NULL
)
180 * This IPP attribute is unnecessarily complicated...
182 * single-document, separate-documents-collated-copies, and
183 * single-document-new-sheet all require collated copies.
185 * separate-documents-uncollated-copies allows for uncollated copies.
188 Collate
= strcasecmp(val
, "separate-documents-uncollated-copies") != 0;
191 if ((val
= cupsGetOption("Collate", num_options
, options
)) != NULL
&&
192 strcasecmp(val
, "True") == 0)
195 if ((val
= cupsGetOption("gamma", num_options
, options
)) != NULL
)
198 * Get gamma value from 1 to 10000...
201 g
= atoi(val
) * 0.001f
;
209 if ((val
= cupsGetOption("brightness", num_options
, options
)) != NULL
)
212 * Get brightness value from 10 to 1000.
215 b
= atoi(val
) * 0.01f
;
223 if ((val
= cupsGetOption("scaling", num_options
, options
)) != NULL
)
224 zoom
= atoi(val
) * 0.01;
225 else if (cupsGetOption("fitplot", num_options
, options
))
228 if ((val
= cupsGetOption("ppi", num_options
, options
)) != NULL
)
229 if (sscanf(val
, "%dx%d", &xppi
, &yppi
) < 2)
232 if ((val
= cupsGetOption("position", num_options
, options
)) != NULL
)
234 if (strcasecmp(val
, "center") == 0)
239 else if (strcasecmp(val
, "top") == 0)
244 else if (strcasecmp(val
, "left") == 0)
249 else if (strcasecmp(val
, "right") == 0)
254 else if (strcasecmp(val
, "top-left") == 0)
259 else if (strcasecmp(val
, "top-right") == 0)
264 else if (strcasecmp(val
, "bottom") == 0)
269 else if (strcasecmp(val
, "bottom-left") == 0)
274 else if (strcasecmp(val
, "bottom-right") == 0)
281 if ((val
= cupsGetOption("saturation", num_options
, options
)) != NULL
)
284 if ((val
= cupsGetOption("hue", num_options
, options
)) != NULL
)
287 if ((val
= cupsGetOption("mirror", num_options
, options
)) != NULL
&&
288 strcasecmp(val
, "True") == 0)
291 if ((val
= cupsGetOption("emit-jcl", num_options
, options
)) != NULL
&&
292 (!strcasecmp(val
, "false") || !strcasecmp(val
, "off") ||
293 !strcasecmp(val
, "no") || !strcmp(val
, "0")))
299 * Open the input image to print...
302 colorspace
= ColorDevice
? CUPS_IMAGE_RGB_CMYK
: CUPS_IMAGE_WHITE
;
304 img
= cupsImageOpen(filename
, colorspace
, CUPS_IMAGE_WHITE
, sat
, hue
, NULL
);
311 fputs("ERROR: Unable to open image file for printing!\n", stderr
);
316 colorspace
= cupsImageGetColorSpace(img
);
319 * Scale as necessary...
322 if (zoom
== 0.0 && xppi
== 0)
324 xppi
= cupsImageGetXPPI(img
);
325 yppi
= cupsImageGetYPPI(img
);
331 fprintf(stderr
, "DEBUG: Before scaling: xppi=%d, yppi=%d, zoom=%.2f\n",
337 * Scale the image as neccesary to match the desired pixels-per-inch.
342 xprint
= (PageTop
- PageBottom
) / 72.0;
343 yprint
= (PageRight
- PageLeft
) / 72.0;
347 xprint
= (PageRight
- PageLeft
) / 72.0;
348 yprint
= (PageTop
- PageBottom
) / 72.0;
351 fprintf(stderr
, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n",
354 xinches
= (float)cupsImageGetWidth(img
) / (float)xppi
;
355 yinches
= (float)cupsImageGetHeight(img
) / (float)yppi
;
357 fprintf(stderr
, "DEBUG: Image size is %.1f x %.1f inches...\n",
360 if ((val
= cupsGetOption("natural-scaling", num_options
, options
)) != NULL
)
362 xinches
= xinches
* atoi(val
) / 100;
363 yinches
= yinches
* atoi(val
) / 100;
366 if (cupsGetOption("orientation-requested", num_options
, options
) == NULL
&&
367 cupsGetOption("landscape", num_options
, options
) == NULL
)
370 * Rotate the image if it will fit landscape but not portrait...
373 fputs("DEBUG: Auto orientation...\n", stderr
);
375 if ((xinches
> xprint
|| yinches
> yprint
) &&
376 xinches
<= yprint
&& yinches
<= xprint
)
379 * Rotate the image as needed...
382 fputs("DEBUG: Using landscape orientation...\n", stderr
);
384 Orientation
= (Orientation
+ 1) & 3;
394 * Scale percentage of page size...
397 xprint
= (PageRight
- PageLeft
) / 72.0;
398 yprint
= (PageTop
- PageBottom
) / 72.0;
399 aspect
= (float)cupsImageGetYPPI(img
) / (float)cupsImageGetXPPI(img
);
401 fprintf(stderr
, "DEBUG: Before scaling: xprint=%.1f, yprint=%.1f\n",
404 fprintf(stderr
, "DEBUG: cupsImageGetXPPI(img) = %d, cupsImageGetYPPI(img) = %d, aspect = %f\n",
405 cupsImageGetXPPI(img
), cupsImageGetYPPI(img
), aspect
);
407 xsize
= xprint
* zoom
;
408 ysize
= xsize
* cupsImageGetHeight(img
) / cupsImageGetWidth(img
) / aspect
;
410 if (ysize
> (yprint
* zoom
))
412 ysize
= yprint
* zoom
;
413 xsize
= ysize
* cupsImageGetWidth(img
) * aspect
/ cupsImageGetHeight(img
);
416 xsize2
= yprint
* zoom
;
417 ysize2
= xsize2
* cupsImageGetHeight(img
) / cupsImageGetWidth(img
) / aspect
;
419 if (ysize2
> (xprint
* zoom
))
421 ysize2
= xprint
* zoom
;
422 xsize2
= ysize2
* cupsImageGetWidth(img
) * aspect
/ cupsImageGetHeight(img
);
425 fprintf(stderr
, "DEBUG: Portrait size is %.2f x %.2f inches\n", xsize
, ysize
);
426 fprintf(stderr
, "DEBUG: Landscape size is %.2f x %.2f inches\n", xsize2
, ysize2
);
428 if (cupsGetOption("orientation-requested", num_options
, options
) == NULL
&&
429 cupsGetOption("landscape", num_options
, options
) == NULL
)
432 * Choose the rotation with the largest area, but prefer
433 * portrait if they are equal...
436 fputs("DEBUG: Auto orientation...\n", stderr
);
438 if ((xsize
* ysize
) < (xsize2
* xsize2
))
441 * Do landscape orientation...
444 fputs("DEBUG: Using landscape orientation...\n", stderr
);
449 xprint
= (PageTop
- PageBottom
) / 72.0;
450 yprint
= (PageRight
- PageLeft
) / 72.0;
455 * Do portrait orientation...
458 fputs("DEBUG: Using portrait orientation...\n", stderr
);
465 else if (Orientation
& 1)
467 fputs("DEBUG: Using landscape orientation...\n", stderr
);
471 xprint
= (PageTop
- PageBottom
) / 72.0;
472 yprint
= (PageRight
- PageLeft
) / 72.0;
476 fputs("DEBUG: Using portrait orientation...\n", stderr
);
480 xprint
= (PageRight
- PageLeft
) / 72.0;
481 yprint
= (PageTop
- PageBottom
) / 72.0;
486 * Compute the number of pages to print and the size of the image on each
490 xpages
= ceil(xinches
/ xprint
);
491 ypages
= ceil(yinches
/ yprint
);
493 xprint
= xinches
/ xpages
;
494 yprint
= yinches
/ ypages
;
496 fprintf(stderr
, "DEBUG: xpages = %dx%.2fin, ypages = %dx%.2fin\n",
497 xpages
, xprint
, ypages
, yprint
);
500 * Update the page size for custom sizes...
503 if ((choice
= ppdFindMarkedChoice(ppd
, "PageSize")) != NULL
&&
504 strcasecmp(choice
->choice
, "Custom") == 0)
506 float width
, /* New width in points */
507 length
; /* New length in points */
508 char s
[255]; /* New custom page size... */
512 * Use the correct width and length for the current orientation...
517 width
= yprint
* 72.0;
518 length
= xprint
* 72.0;
522 width
= xprint
* 72.0;
523 length
= yprint
* 72.0;
527 * Add margins to page size...
530 width
+= ppd
->custom_margins
[0] + ppd
->custom_margins
[2];
531 length
+= ppd
->custom_margins
[1] + ppd
->custom_margins
[3];
534 * Enforce minimums...
537 if (width
< ppd
->custom_min
[0])
538 width
= ppd
->custom_min
[0];
540 if (length
< ppd
->custom_min
[1])
541 length
= ppd
->custom_min
[1];
543 fprintf(stderr
, "DEBUG: Updated custom page size to %.2f x %.2f inches...\n",
544 width
/ 72.0, length
/ 72.0);
547 * Set the new custom size...
550 sprintf(s
, "Custom.%.0fx%.0f", width
, length
);
551 ppdMarkOption(ppd
, "PageSize", s
);
554 * Update page variables...
559 PageLeft
= ppd
->custom_margins
[0];
560 PageRight
= width
- ppd
->custom_margins
[2];
561 PageBottom
= ppd
->custom_margins
[1];
562 PageTop
= length
- ppd
->custom_margins
[3];
566 * See if we need to collate, and if so how we need to do it...
569 if (xpages
== 1 && ypages
== 1)
572 slowcollate
= Collate
&& ppdFindOption(ppd
, "Collate") == NULL
;
574 if (Copies
> 1 && !slowcollate
)
583 * Write any "exit server" options that have been selected...
586 ppdEmit(ppd
, stdout
, PPD_ORDER_EXIT
);
589 * Write any JCL commands that are needed to print PostScript code...
593 ppdEmitJCL(ppd
, stdout
, atoi(argv
[1]), argv
[2], argv
[3]);
596 * Start sending the document with any commands needed...
599 curtime
= time(NULL
);
600 curtm
= localtime(&curtime
);
602 puts("%!PS-Adobe-3.0");
603 printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n", PageLeft
, PageBottom
,
605 printf("%%%%LanguageLevel: %d\n", LanguageLevel
);
606 printf("%%%%Pages: %d\n", xpages
* ypages
* Copies
);
607 puts("%%DocumentData: Clean7Bit");
608 puts("%%DocumentNeededResources: font Helvetica-Bold");
609 puts("%%Creator: imagetops/" CUPS_SVERSION
);
610 strftime(curdate
, sizeof(curdate
), "%c", curtm
);
611 printf("%%%%CreationDate: %s\n", curdate
);
612 printf("%%%%Title: %s\n", argv
[3]);
613 printf("%%%%For: %s\n", argv
[2]);
615 puts("%%Orientation: Landscape");
617 puts("%%Orientation: Portrait");
618 puts("%%EndComments");
619 puts("%%BeginProlog");
621 if (ppd
!= NULL
&& ppd
->patches
!= NULL
)
624 ppdEmit(ppd
, stdout
, PPD_ORDER_DOCUMENT
);
625 ppdEmit(ppd
, stdout
, PPD_ORDER_ANY
);
626 ppdEmit(ppd
, stdout
, PPD_ORDER_PROLOG
);
628 if (g
!= 1.0 || b
!= 1.0)
629 printf("{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
630 "ifelse %.3f mul } bind settransfer\n", g
, b
);
636 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
637 PageBottom
, PageTop
, PageWidth
);
641 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
642 PageLeft
, PageRight
, PageLength
);
646 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
647 PageLength
- PageTop
, PageLength
- PageBottom
,
652 WriteLabelProlog(cupsGetOption("page-label", num_options
, options
),
653 PageWidth
- PageRight
, PageWidth
- PageLeft
,
660 if (ppd
== NULL
|| ppd
->language_level
== 1)
661 printf("/#copies %d def\n", realcopies
);
663 printf("<</NumCopies %d>>setpagedevice\n", realcopies
);
669 * Output the pages...
672 row
= malloc(cupsImageGetWidth(img
) * abs(colorspace
) + 3);
674 fprintf(stderr
, "DEBUG: XPosition=%d, YPosition=%d, Orientation=%d\n",
675 XPosition
, YPosition
, Orientation
);
676 fprintf(stderr
, "DEBUG: xprint=%.0f, yprint=%.0f\n", xprint
, yprint
);
677 fprintf(stderr
, "DEBUG: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f\n",
678 PageLeft
, PageRight
, PageWidth
);
679 fprintf(stderr
, "DEBUG: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f\n",
680 PageBottom
, PageTop
, PageLength
);
691 left
= (PageRight
+ PageLeft
- xprint
* 72) / 2;
694 left
= PageRight
- xprint
* 72;
701 top
= PageBottom
+ yprint
* 72;
704 top
= (PageTop
+ PageBottom
+ yprint
* 72) / 2;
719 left
= (PageTop
+ PageBottom
- xprint
* 72) / 2;
722 left
= PageTop
- xprint
* 72;
729 top
= PageLeft
+ yprint
* 72;
732 top
= (PageRight
+ PageLeft
+ yprint
* 72) / 2;
747 left
= (PageRight
+ PageLeft
- xprint
* 72) / 2;
750 left
= PageRight
- xprint
* 72;
757 top
= PageBottom
+ yprint
* 72;
760 top
= (PageTop
+ PageBottom
+ yprint
* 72) / 2;
775 left
= (PageTop
+ PageBottom
- xprint
* 72) / 2;
778 left
= PageTop
- xprint
* 72;
785 top
= PageLeft
+ yprint
* 72;
788 top
= (PageRight
+ PageLeft
+ yprint
* 72) / 2;
797 fprintf(stderr
, "DEBUG: left=%.2f, top=%.2f\n", left
, top
);
799 for (page
= 1; Copies
> 0; Copies
--)
800 for (xpage
= 0; xpage
< xpages
; xpage
++)
801 for (ypage
= 0; ypage
< ypages
; ypage
++, page
++)
803 if (ppd
&& ppd
->num_filters
== 0)
804 fprintf(stderr
, "PAGE: %d %d\n", page
, realcopies
);
806 fprintf(stderr
, "INFO: Printing page %d...\n", page
);
808 printf("%%%%Page: %d %d\n", page
, page
);
810 ppdEmit(ppd
, stdout
, PPD_ORDER_PAGE
);
815 printf("%.0f 0 translate -1 1 scale\n", PageWidth
);
819 case 1 : /* Landscape */
820 printf("%.0f 0 translate 90 rotate\n", PageWidth
);
822 case 2 : /* Reverse Portrait */
823 printf("%.0f %.0f translate 180 rotate\n", PageWidth
, PageLength
);
825 case 3 : /* Reverse Landscape */
826 printf("0 %.0f translate -90 rotate\n", PageLength
);
832 xc0
= cupsImageGetWidth(img
) * xpage
/ xpages
;
833 xc1
= cupsImageGetWidth(img
) * (xpage
+ 1) / xpages
- 1;
834 yc0
= cupsImageGetHeight(img
) * ypage
/ ypages
;
835 yc1
= cupsImageGetHeight(img
) * (ypage
+ 1) / ypages
- 1;
837 printf("%.1f %.1f translate\n", left
, top
);
839 printf("%.3f %.3f scale\n\n",
840 xprint
* 72.0 / (xc1
- xc0
+ 1),
841 yprint
* 72.0 / (yc1
- yc0
+ 1));
843 if (LanguageLevel
== 1)
845 printf("/picture %d string def\n", (xc1
- xc0
+ 1) * abs(colorspace
));
846 printf("%d %d 8[1 0 0 -1 0 1]", (xc1
- xc0
+ 1), (yc1
- yc0
+ 1));
848 if (colorspace
== CUPS_IMAGE_WHITE
)
849 puts("{currentfile picture readhexstring pop} image");
851 printf("{currentfile picture readhexstring pop} false %d colorimage\n",
854 for (y
= yc0
; y
<= yc1
; y
++)
856 cupsImageGetRow(img
, xc0
, y
, xc1
- xc0
+ 1, row
);
857 ps_hex(row
, (xc1
- xc0
+ 1) * abs(colorspace
), y
== yc1
);
864 case CUPS_IMAGE_WHITE
:
865 puts("/DeviceGray setcolorspace");
867 case CUPS_IMAGE_RGB
:
868 puts("/DeviceRGB setcolorspace");
870 case CUPS_IMAGE_CMYK
:
871 puts("/DeviceCMYK setcolorspace");
879 "/BitsPerComponent 8",
880 xc1
- xc0
+ 1, yc1
- yc0
+ 1);
884 case CUPS_IMAGE_WHITE
:
885 fputs("/Decode[0 1]", stdout
);
887 case CUPS_IMAGE_RGB
:
888 fputs("/Decode[0 1 0 1 0 1]", stdout
);
890 case CUPS_IMAGE_CMYK
:
891 fputs("/Decode[0 1 0 1 0 1 0 1]", stdout
);
895 fputs("\n/DataSource currentfile/ASCII85Decode filter", stdout
);
897 if (((xc1
- xc0
+ 1) / xprint
) < 100.0)
898 fputs("/Interpolate true", stdout
);
900 puts("/ImageMatrix[1 0 0 -1 0 1]>>image");
902 for (y
= yc0
, out_offset
= 0; y
<= yc1
; y
++)
904 cupsImageGetRow(img
, xc0
, y
, xc1
- xc0
+ 1, row
+ out_offset
);
906 out_length
= (xc1
- xc0
+ 1) * abs(colorspace
) + out_offset
;
907 out_offset
= out_length
& 3;
909 ps_ascii85(row
, out_length
, y
== yc1
);
912 memcpy(row
, row
+ out_length
- out_offset
, out_offset
);
925 * End the job with the appropriate JCL command or CTRL-D otherwise.
930 if (ppd
&& ppd
->jcl_end
)
931 ppdEmitJCLEnd(ppd
, stdout
);
948 * 'ps_hex()' - Print binary data as a series of hexadecimal numbers.
952 ps_hex(cups_ib_t
*data
, /* I - Data to print */
953 int length
, /* I - Number of bytes to print */
954 int last_line
) /* I - Last line of raster data? */
956 static int col
= 0; /* Current column */
957 static char *hex
= "0123456789ABCDEF";
964 * Put the hex chars out to the file; note that we don't use printf()
965 * for speed reasons...
968 putchar(hex
[*data
>> 4]);
969 putchar(hex
[*data
& 15]);
982 if (last_line
&& col
)
991 * 'ps_ascii85()' - Print binary data as a series of base-85 numbers.
995 ps_ascii85(cups_ib_t
*data
, /* I - Data to print */
996 int length
, /* I - Number of bytes to print */
997 int last_line
) /* I - Last line of raster data? */
999 unsigned b
; /* Binary data word */
1000 unsigned char c
[5]; /* ASCII85 encoded chars */
1001 static int col
= 0; /* Current column */
1006 b
= (((((data
[0] << 8) | data
[1]) << 8) | data
[2]) << 8) | data
[3];
1015 c
[4] = (b
% 85) + '!';
1017 c
[3] = (b
% 85) + '!';
1019 c
[2] = (b
% 85) + '!';
1021 c
[1] = (b
% 85) + '!';
1025 fwrite(c
, 5, 1, stdout
);
1043 memset(data
+ length
, 0, 4 - length
);
1044 b
= (((((data
[0] << 8) | data
[1]) << 8) | data
[2]) << 8) | data
[3];
1046 c
[4] = (b
% 85) + '!';
1048 c
[3] = (b
% 85) + '!';
1050 c
[2] = (b
% 85) + '!';
1052 c
[1] = (b
% 85) + '!';
1056 fwrite(c
, length
+ 1, 1, stdout
);
1066 * End of "$Id: imagetops.c 5379 2006-04-07 13:48:37Z mike $".