]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
libcupsfilters: Allow mupdftoraster() be used for all raster formats
authorTill Kamppeter <till.kamppeter@gmail.com>
Mon, 28 Mar 2022 11:04:07 +0000 (13:04 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Mon, 28 Mar 2022 11:04:07 +0000 (13:04 +0200)
commitf40284df08ca4b2f87f91f3a45ae59affbef215b
tree9d050bf26cca8495030df6c15cc52280fa6ecf57
parent0e54efce8b6b3649c4dbcf72c6dca2b6021893d9
libcupsfilters: Allow mupdftoraster() be used for all raster formats

The mupdftoraster() filter function only produces PWG Raster, due to
the fact that mutool of MuPDF produces PWG Raster but not Apple
Raster, CUPS Raster, or PCLm.

To obtain the other formats one needs post-filtering with pwgtoraster
and rastertopclm. To make this working in the best possible way and to
make it working at all with any PPD file (also those which do not have
information for generating the inbetween PWG Raster format) we have
prepared mupdftoraster appropriately.

Changes done:

- Get final output format via parameters

- Call cupsRasterPrepareHeader() with PWG Raster as header format and
  the final output format as final format

- If the final format is not PWG Raster we need post-filtering. In
  this case let mutool only generate output with a maximum of 3 color
  channels (no CMYK) as the post filters pwgtoraster and rastertopclm
  only support 1- or 3-color-channel input.

- Add explicit support for the RGBW color space (#17, used by HPLIP's
  hpcups driver).

- On an unknown final output color space default to color instead of
  mono output. A post filter can turn color into monochrome but not
  vice-versa.

- Let the CUPS filter wrapper read the final output format from the
  FINAL_CONTENT_TYPE environment variable. Default to CUPS Raster on
  an unknown format, as those formats typically come from CUPS Raster
  ("rasterto...") drivers.

- Do not pass in the full list of environment variables any more. We
  do not manipulate these. Instead we call mutool with execvp() to
  simply use the caller's environment instead of execvpe() with a
  supplied environment.

- Update the MIME rules: Remove rule telling that mupdftoraster
  outputs CUPS Raster, add rules for pwgtoraster, and also rules to
  reflect that rastertopclm also accepts Apple Raster or PWG Raster as
  input.
cupsfilters/filter.h
cupsfilters/mupdftoraster.c
filter/mupdftoraster.c
mime/cupsfilters-individual.convs
mime/cupsfilters-mupdf.convs