Skip to content

Support Canon CNIJMediaType printer option - #21689

Merged
TurboGit merged 3 commits into
darktable-org:masterfrom
carlosbuitragosan:master
Aug 26, 2026
Merged

Support Canon CNIJMediaType printer option#21689
TurboGit merged 3 commits into
darktable-org:masterfrom
carlosbuitragosan:master

Conversation

@carlosbuitragosan

Copy link
Copy Markdown
Contributor

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

@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
Contributor Author

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

Comment thread src/common/cups_print.c
Comment thread src/common/cups_print.c Outdated
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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to me now, thanks!

@TurboGit TurboGit added this to the 5.8 milestone Aug 24, 2026
@TurboGit TurboGit added feature: enhancement current features to improve priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending scope: print all cups and printing related issues labels Aug 24, 2026
@TurboGit

Copy link
Copy Markdown
Member

@carlosbuitragosan : We need a release notes entry for this. TIA.

@TurboGit
TurboGit merged commit 65b8656 into darktable-org:master Aug 26, 2026
6 checks passed
@carlosbuitragosan

Copy link
Copy Markdown
Contributor Author

Will do asap

deekayhd pushed a commit to deekayhd/darktable that referenced this pull request Aug 30, 2026
* Support Canon CNIJMediaType printer option

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: enhancement current features to improve priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: print all cups and printing related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants