Skip to content

Commit d19e913

Browse files
committed
Use unified print-as-raster
1 parent c7b3574 commit d19e913

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

backend/ipp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ main(int argc, /* I - Number of command-line args */
19521952
* Need to reprocess the job as raster...
19531953
*/
19541954

1955-
fputs("JOBSTATE: force-raster\n", stderr);
1955+
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
19561956
if (job_id > 0)
19571957
cancel_job(http, uri, job_id, resource, username, version);
19581958

@@ -2738,7 +2738,7 @@ monitor_printer(
27382738
*/
27392739

27402740
job_canceled = 1;
2741-
fputs("JOBSTATE: force-raster\n", stderr);
2741+
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
27422742
}
27432743
else if (new_reasons & _CUPS_JSR_DOCUMENT_FORMAT_ERROR)
27442744
{

cups/encode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ static const _ipp_option_t ipp_options[] =
136136
{ 0, "fit-to-page-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
137137
{ 0, "fitplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
138138
{ 0, "fitplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
139-
{ 0, "force-raster", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
139+
{ 0, "print-as-raster", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
140+
{ 0, "print-as-raster-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
140141
{ 0, "gamma", IPP_TAG_INTEGER, IPP_TAG_JOB },
141142
{ 0, "gamma-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
142143
{ 0, "hue", IPP_TAG_INTEGER, IPP_TAG_JOB },

scheduler/ipp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,8 +1517,8 @@ add_job(cupsd_client_t *con, /* I - Client connection */
15171517
return (NULL);
15181518
}
15191519

1520-
if (ippGetBoolean(ippFindAttribute(con->request, "force-raster", IPP_TAG_BOOLEAN), 0))
1521-
job->force_raster = 1;
1520+
if (ippGetBoolean(ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN), 0))
1521+
job->print_as_raster = 1;
15221522

15231523
job->dtype = printer->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE);
15241524
job->attrs = con->request;

scheduler/job.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */
579579

580580
cupsRWLockWrite(&MimeDatabase->lock);
581581

582-
if (job->force_raster)
582+
if (job->print_as_raster)
583583
{
584584
/*
585585
* Need to figure out whether the printer supports image/pwg-raster or
@@ -596,9 +596,9 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */
596596
}
597597

598598
if (dst)
599-
cupsdLogJob(job, CUPSD_LOG_DEBUG, "Forcing job as \"%s\".", strchr(dst->type, '/') + 1);
599+
cupsdLogJob(job, CUPSD_LOG_DEBUG, "%s job as \"%s\".", job->print_as_raster > 0 ? "Printing" : "Retrying", strchr(dst->type, '/') + 1);
600600
else
601-
cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to force job using a supported raster format.");
601+
cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to force job using a supported raster format.");
602602
}
603603

604604
filters = mimeFilter2(MimeDatabase, job->filetypes[job->current_file], (size_t)fileinfo.st_size, dst, &(job->cost));
@@ -5246,8 +5246,8 @@ update_job(cupsd_job_t *job) /* I - Job to check */
52465246

52475247
cupsdLogJob(job, CUPSD_LOG_DEBUG, "JOBSTATE: %s", message);
52485248

5249-
if (!strcmp(message, "force-raster"))
5250-
job->force_raster = 1;
5249+
if (!strcmp(message, "cups-retry-as-raster"))
5250+
job->print_as_raster = -1;
52515251
else
52525252
ippSetString(job->attrs, &job->reasons, 0, message);
52535253
}

scheduler/job.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ struct cupsd_job_s /**** Job request ****/
7676
int status; /* Status code from filters */
7777
int tries; /* Number of tries for this job */
7878
int completed; /* cups-waiting-for-job-completed seen */
79-
int force_raster; /* Need to force the job as raster */
79+
int print_as_raster;
80+
/* Need to print the job as raster */
8081
char *auth_env[3], /* AUTH_xxx environment variables,
8182
* if any */
8283
*auth_uid; /* AUTH_UID environment variable */

0 commit comments

Comments
 (0)