summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2017-06-19 08:38:07 +0200
committerDidier Raboud <odyx@debian.org>2017-06-19 08:38:07 +0200
commitaedf3e93e811c6c9d504274172861d266e1c5c97 (patch)
tree95e525108c5b6bd2ea3fa689cf11bfe4a5b982a9 /test
parent7bd83d89975d166521a0b326b64b4cad80117750 (diff)
New upstream version 5.2.13~pre1
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in7
-rw-r--r--test/bjc-unprint.c2
-rw-r--r--test/pcl-unprint.c4
-rw-r--r--test/pixma_parse.c181
-rwxr-xr-xtest/run-testdither18
-rw-r--r--test/unprint.c4
6 files changed, 124 insertions, 92 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 6df20f3..933d551 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -428,9 +428,11 @@ BZIP2 = @BZIP2@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+COMPRESS = @COMPRESS@
CONVERT = @CONVERT@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSUF = @CSUF@
CUPS_CFLAGS = @CUPS_CFLAGS@
CUPS_CONFIG = @CUPS_CONFIG@
CUPS_LIBS = @CUPS_LIBS@
@@ -489,6 +491,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@
GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@
GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@
GUTENPRINT_VERSION = @GUTENPRINT_VERSION@
+GZIP = @GZIP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -514,6 +517,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
+LRZIP = @LRZIP@
LTALLOCA = @LTALLOCA@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
@@ -541,6 +545,7 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
+PKGROOT = @PKGROOT@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@@ -549,6 +554,7 @@ POSUB = @POSUB@
RANLIB = @RANLIB@
RELEASE_DATE = @RELEASE_DATE@
RM = @RM@
+RZIP = @RZIP@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -561,6 +567,7 @@ VERSION = @VERSION@
WHICH_PPDS = @WHICH_PPDS@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
+XZ = @XZ@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
diff --git a/test/bjc-unprint.c b/test/bjc-unprint.c
index 8a5bd0f..bb1d070 100644
--- a/test/bjc-unprint.c
+++ b/test/bjc-unprint.c
@@ -446,7 +446,7 @@ int process(FILE *infile,scanline_t *sf[7],int *xmin_,int *xmax_,int *ymin_,int
case 0x6d: col= 5; break; /* lightmagenta */
case 0x63: col= 6; break; /* lightcyan */
default:
- fprintf(stderr,"unkown color component 0x%02x\n",inbuff[0]);
+ fprintf(stderr,"unknown color component 0x%02x\n",inbuff[0]);
exit(-1);
}
diff --git a/test/pcl-unprint.c b/test/pcl-unprint.c
index 1ceee84..3d16047 100644
--- a/test/pcl-unprint.c
+++ b/test/pcl-unprint.c
@@ -436,7 +436,7 @@ void pcl_read_command(void)
if (initial_command[0] == '%') {
#ifdef DEBUG
- fprintf(stderr, "ESC%% commmand\n");
+ fprintf(stderr, "ESC%% command\n");
#endif
initial_command[initial_command_index] = '\0';
}
@@ -462,7 +462,7 @@ void pcl_read_command(void)
/*
We get here if either this is a combined sequence, or we have processed
the beginning of a parameterised sequence. There is an optional number
- next, which may be preceeded by "+" or "-". FIXME We should also handle
+ next, which may be preceded by "+" or "-". FIXME We should also handle
decimal points.
*/
diff --git a/test/pixma_parse.c b/test/pixma_parse.c
index ec79c5a..872a7cd 100644
--- a/test/pixma_parse.c
+++ b/test/pixma_parse.c
@@ -26,7 +26,7 @@
#define MAX_COLORS 36 /* was: 8 maximum number of Colors: CMYKcmyk */
-#define DEBUG 0 /* 1 for debugging only */
+#define DEBUG 0 /* 1 for debugging only: all output goes to stderr */
#include "pixma_parse.h"
@@ -35,7 +35,8 @@
2. keep iP6700 workaround, but check what happens with the real printer.
*/
-
+/* redirection for debug output */
+FILE* fout;
/* nextcmd(): find a command in a printjob
* commands in the printjob start with either ESC[ or ESC(
@@ -67,13 +68,13 @@ static int nextcmd( FILE *infile,unsigned char* cmd,unsigned char *buf, unsigned
/* start */
startxml=680-1;
fread(buf,1,startxml,infile); /* 1 less than 680 */
- fprintf(stderr,"nextcmd: read starting XML %d %d\n", *xml_read, startxml);
+ fprintf(fout,"nextcmd: read starting XML %d %d\n", *xml_read, startxml);
*xml_read=1;
}else if (*xml_read==1) {
/* end */
endxml=263-1;
fread(buf,1,endxml,infile); /* 1 less than 263*/
- fprintf(stderr,"nextcmd: read ending XML %d %d\n", *xml_read, endxml);
+ fprintf(fout,"nextcmd: read ending XML %d %d\n", *xml_read, endxml);
*xml_read=2;
}
/* no alternatives yet */
@@ -91,20 +92,20 @@ static int nextcmd( FILE *infile,unsigned char* cmd,unsigned char *buf, unsigned
if (*cnt){ /* read arguments */
unsigned int read;
if((read=fread(buf,1,*cnt,infile)) != *cnt){
- fprintf(stderr,"nextcmd: read error - not enough data %d %d\n", read, *cnt);
+ fprintf(fout,"nextcmd: read error - not enough data %d %d\n", read, *cnt);
return -1;
}
}
return 0;
}else if(c2 == '@'){ /* ESC@ */
- fprintf(stderr,"ESC @ Return to neutral mode\n");
+ fprintf(fout,"ESC @ Return to neutral mode\n");
} else {
- fprintf(stderr,"unknown byte following ESC %x \n",c2);
+ fprintf(fout,"unknown byte following ESC %x \n",c2);
}
}else if(c1==0x0c){ /* Form Feed */
- fprintf(stderr,"-->Form Feed\n");
+ fprintf(fout,"-->Form Feed\n");
}else{
- fprintf(stderr,"UNKNOWN BYTE 0x%x @ %lu\n",c1,ftell(infile));
+ fprintf(fout,"UNKNOWN BYTE 0x%x @ %lu\n",c1,ftell(infile));
}
}
return -1;
@@ -140,7 +141,7 @@ static int valid_color(unsigned char color){
for(i=0;i<sizeof(valid_colors) / sizeof(valid_colors[0]);i++)
if(valid_colors[i] == color)
return 1;
- fprintf(stderr," [valid_color] unknown color 0x%x\n",color);
+ fprintf(fout," [valid_color] unknown color 0x%x\n",color);
return 0;
}
@@ -251,7 +252,7 @@ static int Raster(image_t* img,unsigned char* buffer,unsigned int len,unsigned c
printf("no matching color for %c (0x%x, %i) in the database => ignoring %i bytes\n",color_name,color_name,color_name, len);
} */
if (DEBUG) {
- fprintf(stderr,"DEBUG enter Raster len=%i,color=%c\n",len,color_name);
+ fprintf(fout,"DEBUG enter Raster len=%i,color=%c\n",len,color_name);
}
/* decode pack bits */
@@ -453,9 +454,9 @@ static void write_line(image_t*img,FILE* fp,int pos_y){
/*if (img->color[i].value != 0)
printf("what pixel values for color %d: %x\n",i,img->color[i].value);*/
if (i>7){
- fprintf(stderr,"getting pixel values for color %d\n",i);/* only going 0 1 2 4 5 --- missing i>7 bugger! */
+ fprintf(fout,"getting pixel values for color %d\n",i);/* only going 0 1 2 4 5 --- missing i>7 bugger! */
/*img->color[i].value = 1;*/
- fprintf(stderr,"color %c has value %d\n",img->color[i].name,img->color[i].value);
+ fprintf(fout,"color %c has value %d\n",img->color[i].name,img->color[i].value);
}
/* add 0x80 to colors where 0x80 is seen added in inkset */
}
@@ -516,7 +517,7 @@ static void write_line(image_t*img,FILE* fp,int pos_y){
/* output line */
if((written = fwrite(line,img->width,3,fp)) != 3) {
- fprintf(stderr,"fwrite failed %u vs %u\n",written,img->width*3);
+ fprintf(fout,"fwrite failed %u vs %u\n",written,img->width*3);
}
free(line);
}
@@ -599,7 +600,7 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
unsigned int xml_read;
xml_read=0;
- fprintf(stderr,"------- parsing the printjob -------\n");
+ fprintf(fout,"------- parsing the printjob -------\n");
while(!returnv && !feof(in)){
unsigned char cmd;
unsigned int cnt = 0;
@@ -607,53 +608,53 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
break;
switch(cmd){
case 'c':
- fprintf(stderr,"ESC (c set media (len=%i):\n",cnt);
- fprintf(stderr," model id %x bw %x",buf[0]>> 4,buf[0]&0xf);
- fprintf(stderr," media %x",buf[1]);
- fprintf(stderr," direction %x quality %x\n",(buf[2]>>4)&3 ,buf[2]&0xf);
+ fprintf(fout,"ESC (c set media (len=%i):\n",cnt);
+ fprintf(fout," model id %x bw %x",buf[0]>> 4,buf[0]&0xf);
+ fprintf(fout," media %x",buf[1]);
+ fprintf(fout," direction %x quality %x\n",(buf[2]>>4)&3 ,buf[2]&0xf);
break;
case 'K':
if(buf[1]==0x1f){
- fprintf(stderr,"ESC [K go to command mode\n");
+ fprintf(fout,"ESC [K go to command mode\n");
do{
fgets((char*)buf,0xFFFF,in);
- fprintf(stderr," %s",buf);
+ fprintf(fout," %s",buf);
}while(strcmp((char*)buf,"BJLEND\n"));
}else if(cnt == 2 && buf[1]==0x0f){
- fprintf(stderr,"ESC [K reset printer\n");
+ fprintf(fout,"ESC [K reset printer\n");
img->width=0;
img->height=0;
}else{
- fprintf(stderr,"ESC [K unsupported param (len=%i): %x\n",cnt,buf[1]);
+ fprintf(fout,"ESC [K unsupported param (len=%i): %x\n",cnt,buf[1]);
}
break;
case 'b':
- fprintf(stderr,"ESC (b set data compression (len=%i): %x\n",cnt,buf[0]);
+ fprintf(fout,"ESC (b set data compression (len=%i): %x\n",cnt,buf[0]);
break;
case 'I':
- fprintf(stderr,"ESC (I select data transmission (len=%i): ",cnt);
- if(buf[0]==0)fprintf(stderr,"default");
- else if(buf[0]==1)fprintf(stderr,"multi raster");
- else fprintf(stderr,"unknown 0x%x %i",buf[0],buf[0]);
- fprintf(stderr,"\n");
+ fprintf(fout,"ESC (I select data transmission (len=%i): ",cnt);
+ if(buf[0]==0)fprintf(fout,"default");
+ else if(buf[0]==1)fprintf(fout,"multi raster");
+ else fprintf(fout,"unknown 0x%x %i",buf[0],buf[0]);
+ fprintf(fout,"\n");
break;
case 'l':
- fprintf(stderr,"ESC (l select paper loading (len=%i):\n",cnt);
- fprintf(stderr," model id 0x%x ",buf[0]>>4);
- fprintf(stderr," source 0x%x",buf[0]&15);
+ fprintf(fout,"ESC (l select paper loading (len=%i):\n",cnt);
+ fprintf(fout," model id 0x%x ",buf[0]>>4);
+ fprintf(fout," source 0x%x",buf[0]&15);
if ( cnt == 3 ) {
- fprintf(stderr," media: %x",buf[1]);
- fprintf(stderr," paper gap: %x\n",buf[2]);
+ fprintf(fout," media: %x",buf[1]);
+ fprintf(fout," paper gap: %x\n",buf[2]);
} else
- fprintf(stderr," media: %x\n",buf[1]);
+ fprintf(fout," media: %x\n",buf[1]);
break;
case 'd':
img->xres = (buf[0]<<8)|buf[1];
img->yres = (buf[2]<<8)|buf[3];
- fprintf(stderr,"ESC (d set raster resolution (len=%i): %i x %i\n",cnt,img->xres,img->yres);
+ fprintf(fout,"ESC (d set raster resolution (len=%i): %i x %i\n",cnt,img->xres,img->yres);
break;
case 't':
- fprintf(stderr,"ESC (t set image cnt %i\n",cnt);
+ fprintf(fout,"ESC (t set image cnt %i\n",cnt);
if(buf[0]>>7){
/* usual order */
char order[]="CMYKcmyk";
@@ -672,23 +673,23 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
/* char order[]="KCcMmYykRHGABDEFIJLMNOPQSTUVWXZabdef"; */
/* int black_found = 0; */
num_colors = (cnt - 3)/3;
- fprintf(stderr," bit_info: using detailed color settings for max %i colors\n",num_colors);
+ fprintf(fout," bit_info: using detailed color settings for max %i colors\n",num_colors);
if(buf[1]==0x80)
- fprintf(stderr," format: BJ indexed color image format\n");
+ fprintf(fout," format: BJ indexed color image format\n");
else if(buf[1]==0x00)
- fprintf(stderr," format: iP8500 flag set, BJ indexed color image format\n");
+ fprintf(fout," format: iP8500 flag set, BJ indexed color image format\n");
else if(buf[1]==0x90)
- fprintf(stderr," format: Pro9500 flag set, BJ indexed color image format\n");
+ fprintf(fout," format: Pro9500 flag set, BJ indexed color image format\n");
else{
- fprintf(stderr," format: settings not supported 0x%x\n",buf[1]);
+ fprintf(fout," format: settings not supported 0x%x\n",buf[1]);
/* returnv = -2; */
}
if(buf[2]==0x1)
- fprintf(stderr," ink: BJ indexed setting, also for iP8500 flag\n");
+ fprintf(fout," ink: BJ indexed setting, also for iP8500 flag\n");
else if(buf[2]==0x4)
- fprintf(stderr," ink: Pro series setting \n");
+ fprintf(fout," ink: Pro series setting \n");
else{
- fprintf(stderr," ink: settings not supported 0x%x\n",buf[2]);
+ fprintf(fout," ink: settings not supported 0x%x\n",buf[2]);
/* returnv = -2; */
}
@@ -735,10 +736,10 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
}
*/
/* %c*/
- fprintf(stderr," Color %c Compression: %i bpp %i level %i\n",img->color[i].name,
+ fprintf(fout," Color %c Compression: %i bpp %i level %i\n",img->color[i].name,
img->color[i].compression,img->color[i].bpp,img->color[i].level);
}else{
- fprintf(stderr," Color %i out of bounds!\n", i);
+ fprintf(fout," Color %i out of bounds!\n", i);
/*printf(" Color ignoring setting %x %x %x\n",buf[3+i*3],buf[3+i*3+1],buf[3+i*3+2]);*/
}
@@ -746,7 +747,7 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
}else if(buf[0]==0x1 && buf[1]==0x0 && buf[2]==0x1){
- fprintf(stderr," 1bit-per pixel\n");
+ fprintf(fout," 1bit-per pixel\n");
num_colors = cnt*3; /*no idea yet! 3 for iP4000 */
/*num_colors=9;*/
/*for(i=0;i<MAX_COLORS;i++){*/
@@ -765,20 +766,20 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
img->color[i].level=2;
img->color[i].density = 255;
/*add color printout for this type also %c */
- fprintf(stderr," Color %c Compression: %i bpp %i level %i\n",img->color[i].name,
+ fprintf(fout," Color %c Compression: %i bpp %i level %i\n",img->color[i].name,
img->color[i].compression,img->color[i].bpp,img->color[i].level);
}else{
- fprintf(stderr," Color %i out of bounds!", i);
+ fprintf(fout," Color %i out of bounds!", i);
/*printf(" Color ignoring setting %x %x %x\n",buf[3+i*3],buf[3+i*3+1],buf[3+i*3+2]);*/
}
}
}else{
- fprintf(stderr," bit_info: unknown settings 0x%x 0x%x 0x%x\n",buf[0],buf[1],buf[2]);
+ fprintf(fout," bit_info: unknown settings 0x%x 0x%x 0x%x\n",buf[0],buf[1],buf[2]);
/* returnv=-2; */
}
break;
case 'L':
- fprintf(stderr,"ESC (L set component order for F raster command (len=%i): ",cnt);
+ fprintf(fout,"ESC (L set component order for F raster command (len=%i): ",cnt);
img->color_order=calloc(1,cnt+1);
/* check if the colors are sane => the iP4000 driver appends invalid bytes in the highest resolution mode */
for(i=0;i<cnt;i++){
@@ -790,21 +791,21 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
/*}*/
/*else {*/
buf[i]=buf[i]-0x60;
- fprintf(stderr,"subtracting 0x60 to give [corrected]: %c\n", buf[i]);
+ fprintf(fout,"subtracting 0x60 to give [corrected]: %c\n", buf[i]);
}
else
- fprintf(stderr,"found valid color char: %c\n",buf[i]);
+ fprintf(fout,"found valid color char: %c\n",buf[i]);
}
cnt = i;
memcpy(img->color_order,buf,cnt);
- fprintf(stderr,"%s\n",img->color_order);
+ fprintf(fout,"%s\n",img->color_order);
img->num_colors = cnt;
img->cur_color=0;
break;
case 'p':
- fprintf(stderr,"ESC (p set extended margin (len=%i):\n",cnt);
- fprintf(stderr," printed length %i left %i\n",((buf[0]<<8 )+buf[1]) *6 / 5 - 1,(buf[2]<<8) + buf[3]);
- fprintf(stderr," printed width %i top %i\n",((buf[4]<<8 )+buf[5]) * 6 / 5 - 1,(buf[6]<<8) + buf[7]);
+ fprintf(fout,"ESC (p set extended margin (len=%i):\n",cnt);
+ fprintf(fout," printed length %i left %i\n",((buf[0]<<8 )+buf[1]) *6 / 5 - 1,(buf[2]<<8) + buf[3]);
+ fprintf(fout," printed width %i top %i\n",((buf[4]<<8 )+buf[5]) * 6 / 5 - 1,(buf[6]<<8) + buf[7]);
if(cnt > 8){
int unit = (buf[12] << 8)| buf[13];
@@ -816,30 +817,30 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
int paper_top = read_uint32(buf+34);
unsigned int paper_width = read_uint32(buf+38);
unsigned int paper_length = read_uint32(buf+42);
- fprintf(stderr," unknown %i\n",read_uint32(buf+8));
- fprintf(stderr," unit %i [1/in]\n",unit);
- fprintf(stderr," area_right %i %.1f mm\n",area_right,area_right * 25.4 / unit);
- fprintf(stderr," area_top %i %.1f mm\n",area_top,area_top * 25.4 / unit);
- fprintf(stderr," area_width %u %.1f mm\n",area_width, area_width * 25.4 / unit);
- fprintf(stderr," area_length %u %.1f mm\n",area_length,area_length * 25.4 / unit);
- fprintf(stderr," paper_right %i %.1f mm\n",paper_right,paper_right * 25.4 / unit);
- fprintf(stderr," paper_top %i %.1f mm\n",paper_top,paper_top * 25.4 / unit);
- fprintf(stderr," paper_width %u %.1f mm\n",paper_width,paper_width * 25.4 / unit);
- fprintf(stderr," paper_length %u %.1f mm\n",paper_length,paper_length * 25.4 / unit);
+ fprintf(fout," unknown %i\n",read_uint32(buf+8));
+ fprintf(fout," unit %i [1/in]\n",unit);
+ fprintf(fout," area_right %i %.1f mm\n",area_right,area_right * 25.4 / unit);
+ fprintf(fout," area_top %i %.1f mm\n",area_top,area_top * 25.4 / unit);
+ fprintf(fout," area_width %u %.1f mm\n",area_width, area_width * 25.4 / unit);
+ fprintf(fout," area_length %u %.1f mm\n",area_length,area_length * 25.4 / unit);
+ fprintf(fout," paper_right %i %.1f mm\n",paper_right,paper_right * 25.4 / unit);
+ fprintf(fout," paper_top %i %.1f mm\n",paper_top,paper_top * 25.4 / unit);
+ fprintf(fout," paper_width %u %.1f mm\n",paper_width,paper_width * 25.4 / unit);
+ fprintf(fout," paper_length %u %.1f mm\n",paper_length,paper_length * 25.4 / unit);
img->top = (float)area_top / unit;
img->left = (float)area_top / unit;
}
break;
case '$':
- fprintf(stderr,"ESC ($ set duplex (len=%i)\n",cnt);
+ fprintf(fout,"ESC ($ set duplex (len=%i)\n",cnt);
break;
case 'J':
- fprintf(stderr,"ESC (J select number of raster lines per block (len=%i): %i\n",cnt,buf[0]);
+ fprintf(fout,"ESC (J select number of raster lines per block (len=%i): %i\n",cnt,buf[0]);
img->lines_per_block=buf[0];
break;
case 'F':
if(verbose)
- fprintf(stderr,"ESC (F raster block (len=%i):\n",cnt);
+ fprintf(fout,"ESC (F raster block (len=%i):\n",cnt);
if((returnv = Raster(img,buf,cnt,img->color_order[img->cur_color],maxw)))
break;
++img->cur_color;
@@ -849,17 +850,17 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
}
break;
case 'q':
- fprintf(stderr,"ESC (q set page id (len=%i):%i\n",cnt,buf[0]);
+ fprintf(fout,"ESC (q set page id (len=%i):%i\n",cnt,buf[0]);
break;
case 'r':
- fprintf(stderr,"ESC (r printer specific command (len=%i): ",cnt);
+ fprintf(fout,"ESC (r printer specific command (len=%i): ",cnt);
for(i=0;i<cnt;i++)
- fprintf(stderr,"0x%x ",buf[i]);
- fprintf(stderr,"\n");
+ fprintf(fout,"0x%x ",buf[i]);
+ fprintf(fout,"\n");
break;
case 'A':
if(verbose)
- fprintf(stderr,"ESC (A raster line (len=%i): color %c\n",cnt,buf[0]);
+ fprintf(fout,"ESC (A raster line (len=%i): color %c\n",cnt,buf[0]);
/* the single line rasters are not terminated by 0x80 => do it here
* instead of 0x80 every raster A command is followed by a 0x0d byte
* the selected color is stored in the first byte
@@ -867,13 +868,13 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
buf[cnt]=0x80;
returnv = Raster(img,buf+1,cnt,buf[0],maxw);
if (fgetc(in)!=0x0d){
- fprintf(stderr,"Raster A not terminated by 0x0d\n");
+ fprintf(fout,"Raster A not terminated by 0x0d\n");
returnv=-4;
}
break;
case 'e': /* Raster skip */
if(verbose)
- fprintf(stderr,"ESC (e advance (len=%i): %i\n",cnt,buf[0]*256+buf[1]);
+ fprintf(fout,"ESC (e advance (len=%i): %i\n",cnt,buf[0]*256+buf[1]);
if(img->lines_per_block){
img->height += (buf[0]*256+buf[1])*img->lines_per_block;
img->cur_color=0;
@@ -881,22 +882,22 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
img->height += (buf[0]*256+buf[1]);
break;
default: /* Last but not least completely unknown commands */
- fprintf(stderr,"ESC (%c UNKNOWN (len=%i)\n",cmd,cnt);
+ fprintf(fout,"ESC (%c UNKNOWN (len=%i)\n",cmd,cnt);
for(i=0;i<cnt;i++)
- fprintf(stderr," 0x%x",buf[i]);
- fprintf(stderr,"\n");
+ fprintf(fout," 0x%x",buf[i]);
+ fprintf(fout,"\n");
}
}
- fprintf(stderr,"-------- finished parsing --------\n");
+ fprintf(fout,"-------- finished parsing --------\n");
if(returnv < -2){ /* was < 0 : work around to see what we get */
- fprintf(stderr,"error: parsing the printjob failed error %i\n",returnv);
+ fprintf(fout,"error: parsing the printjob failed error %i\n",returnv);
} else {
- fprintf(stderr,"created bit image with width %i height %i\n",img->width,img->height);
+ fprintf(fout,"created bit image with width %i height %i\n",img->width,img->height);
if(maxh > 0){
- fprintf(stderr,"limiting height to %u\n",maxh);
+ fprintf(fout,"limiting height to %u\n",maxh);
img->height=maxh;
}
@@ -905,7 +906,7 @@ static int process(FILE* in, FILE* out,int verbose,unsigned int maxw,unsigned in
*/
if(out)
write_ppm(img,out);
- fprintf(stderr,"dots: %u\n",img->dots);
+ fprintf(fout,"dots: %u\n",img->dots);
}
/* deallocate resources */
@@ -947,7 +948,13 @@ int main(int argc,char* argv[]){
char* filename_in=NULL,*filename_out=NULL;
FILE *in,*out=NULL;
int i;
- printf("pixma_parse - parser for Canon BJL printjobs (c) 2005-2007 Sascha Sommer <saschasommer@freenet.de>\nPlease note parse output now goes to stderr.\n");
+
+ if (DEBUG)
+ fout = stderr; /* unbuffered */
+ else
+ fout = stdout; /* buffered */
+
+ printf("pixma_parse - parser for Canon BJL printjobs (c) 2005-2007 Sascha Sommer <saschasommer@freenet.de>\n");
/* parse args */
for(i=1;i<argc;i++){
diff --git a/test/run-testdither b/test/run-testdither
index 89a43ef..b402588 100755
--- a/test/run-testdither
+++ b/test/run-testdither
@@ -1,5 +1,23 @@
#!/bin/sh
+# Driver for testdither
+#
+# Copyright 2001-2008 Robert Krawitz (rlk@alum.mit.edu)
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
out_status=0
if [ -z "$srcdir" -o "$srcdir" = "." ] ; then
diff --git a/test/unprint.c b/test/unprint.c
index a3b5a97..3b1e5ef 100644
--- a/test/unprint.c
+++ b/test/unprint.c
@@ -417,7 +417,7 @@ expand_line (unsigned char *src, unsigned char *dst, int height, int skip,
/*
* src is a pointer to a bit stream which is composed of fields of height
* bpp starting with the most significant bit of the first byte and
- * proceding from there with no regard to byte boundaries. For the
+ * proceeding from there with no regard to byte boundaries. For the
* existing Epson printers, bpp is 1 or 2, which means fields will never
* cross byte boundaries. However, if bpp were 3, this would undoubtedly
* happen. This routine will make no assumptions about bpp, and handle each
@@ -1715,7 +1715,7 @@ main(int argc,char *argv[])
{
if (!(fp_w = fopen(argv[arg],"w")))
{
- perror("Error opening ouput file");
+ perror("Error opening output file");
exit(-1);
}
}