Commit e75b3d1
print: fix color management when using printer ICC profiles
When a printer ICC profile is selected, darktable applies the color
conversion via LittleCMS but fails to communicate this to the
downstream CUPS pipeline, causing incorrect color output.
This commit fixes the issue on both Linux and macOS:
1. The printer.profile field on the print info struct was never
populated from the user's profile selection, so the cm-calibration
CUPS option was always set to "false". Fixed by propagating the
profile selection into printer.profile before calling dt_print_file().
2. On Linux, cm-calibration=true tells pdftoraster to skip its own
color management, preventing double conversion.
3. On macOS, cgpdftoraster ignores cm-calibration entirely. Two
additional fixes are needed:
- Embed the ICC profile in the PDF so cgpdftoraster knows the
pixel data is not sRGB (without this, it misinterprets the
already-converted data).
- Send AP_ColorMatchingMode=AP_ApplicationColorMatching (both
dot and underscore variants) to tell cgpdftoraster and the
printer driver that the application already handled color
matching.
Note: on Linux, the ICC profile must NOT be embedded in the PDF —
Poppler (inside pdftoraster) would see the ICCBased color space and
convert the data back to sRGB, undoing the LittleCMS conversion.
Tested on macOS with Canon Pixma Pro-100 against Capture One output.1 parent af59b5d commit e75b3d1
2 files changed
Lines changed: 46 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
551 | 561 | | |
552 | 562 | | |
553 | 563 | | |
554 | 564 | | |
555 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
556 | 580 | | |
557 | 581 | | |
558 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
462 | 470 | | |
463 | 471 | | |
464 | 472 | | |
| |||
779 | 787 | | |
780 | 788 | | |
781 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
782 | 797 | | |
783 | 798 | | |
784 | 799 | | |
| |||
0 commit comments