Skip to content

Support Canon CNIJMediaType printer option - #21689

Open
carlosbuitragosan wants to merge 2 commits into
darktable-org:masterfrom
carlosbuitragosan:master
Open

Support Canon CNIJMediaType printer option#21689
carlosbuitragosan wants to merge 2 commits into
darktable-org:masterfrom
carlosbuitragosan:master

Conversation

@carlosbuitragosan

Copy link
Copy Markdown

Summary

Some Canon printer drivers expose the media type PPD option as
CNIJMediaType instead of the standard MediaType.

This patch falls back to CNIJMediaType when MediaType is unavailable,
both when enumerating available media types and when submitting print jobs.

This restores paper type selection for printers that expose
CNIJMediaType while preserving the existing behavior for printers that
provide the standard MediaType option.

Tested

  • Canon iX6800 series
  • macOS

Verified that:

  • media types are correctly listed in the print dialog
  • the selected media type is passed to CUPS (CNIJMediaType=<value>)
  • printing works correctly

Some Canon printer drivers expose the media type PPD option as
CNIJMediaType instead of the standard MediaType.

Fall back to CNIJMediaType when MediaType is unavailable, both when
enumerating media types and when submitting print jobs.

This restores paper type selection for affected Canon printers while
preserving existing behavior for printers that provide the standard
MediaType option.
@TurboGit

TurboGit commented Aug 6, 2026

Copy link
Copy Markdown
Member

This does not compile on CI, see:

cups_print.c.o.d -o bin/CMakeFiles/lib_darktable.dir/common/cups_print.c.o -c /__w/darktable/darktable/src/src/common/cups_print.c
/__w/darktable/darktable/src/src/common/cups_print.c: In function 'dt_print_file':
/__w/darktable/darktable/src/src/common/cups_print.c:591:22: error: 'ppd' undeclared (first use in this function)
  591 |     if(ppdFindOption(ppd, "MediaType"))
      |                      ^~~
compilation terminated due to -Wfatal-errors.

@carlosbuitragosan : Can you fix please. TIA.

@carlosbuitragosan

Copy link
Copy Markdown
Author

I’ve fixed the CNIJMediaType handling and pushed the fix in the latest commit. The code now compiles successfully locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants