Skip to content

Commit

Permalink
cfFilterGhostscript(): Never supply "-dDEVICEWIDTHPOINTS=0 -dDEVICEHE…
Browse files Browse the repository at this point in the history
…IGHTPOINTS=0"

If no page size got requested with the job (page dimensions are zero
in raster header) skip these arguments so that Ghostscript uses the
page dimensions of the input page.
  • Loading branch information
tillkamppeter committed Nov 29, 2022
1 parent cb05e56 commit 55c74cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## CHANGES IN V2.0b2 (TBA)

- cfFilterGhostscript(): Never supply "-dDEVICEWIDTHPOINTS=0
-dDEVICEHEIGHTPOINTS=0", if no page size got requested with the job
(page dimensions are zero in raster header) skip these arguments so
that Ghostscript uses the page dimensions of the input page.

- libcupsfilters.pc.in: Added libqpdf under "Libs.private".

- configure.ac: Added "foreign" to to AM_INIT_AUTOMAKE() call. Makes
Expand Down
11 changes: 7 additions & 4 deletions cupsfilters/ghostscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,13 @@ header_to_gs_args(gs_page_header *h,
if (h->OutputFaceUp)
cupsArrayAdd(gs_args, strdup("-dOutputFaceUp"));
}
snprintf(tmpstr, sizeof(tmpstr), "-dDEVICEWIDTHPOINTS=%d", h->PageSize[0]);
cupsArrayAdd(gs_args, strdup(tmpstr));
snprintf(tmpstr, sizeof(tmpstr), "-dDEVICEHEIGHTPOINTS=%d", h->PageSize[1]);
cupsArrayAdd(gs_args, strdup(tmpstr));
if (h->PageSize[0] > 0 && h->PageSize[1] > 0)
{
snprintf(tmpstr, sizeof(tmpstr), "-dDEVICEWIDTHPOINTS=%d", h->PageSize[0]);
cupsArrayAdd(gs_args, strdup(tmpstr));
snprintf(tmpstr, sizeof(tmpstr), "-dDEVICEHEIGHTPOINTS=%d", h->PageSize[1]);
cupsArrayAdd(gs_args, strdup(tmpstr));
}
if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
Expand Down

0 comments on commit 55c74cf

Please sign in to comment.