Commit 2892e9a
committed
Ignore unsupported resolution values
Since some time the print dialog of Google's Chrome browser send the
attribute "Resolution=96dpi" with its print jobs (job itself sent in
PDF format). This is a resolution which most modern printers do not
support and usually the print filters and drivers should ignore
unsupported values for any option or IPP attribute, so such an
attribute should not harm.
Unfortunately, in some cases the validity of the resolution value is
not checked and so the wrong value makes it through to the actual
rasterization, messing up the printouts as a raster with a much too
low, unsupported resolution is sent to the printer.
This commit solves the problem by actually checking the resolution
values. This is done in the raster_base_header() function which
generates a CUPS/PWG Raster header from scratch, solely based on
printer and job IPP attributes, and the option list supplied to the
filter functions. This function is called by the
cfRasterPrepareHeader() API function which creates a CUPS/PWG Raster
header for the filter functions, either as base for the page headers
in CUPS/PWG/Apple Raster output or to get a data structure with all
important page properties. He we add a check now, by passing
resolutions parsed from the options through the
cfIPPAttrResolutionForPrinter() function. This way wrong values get
ignored and the default value be used instead. If there are no printer
attributes available, any resolution value is accepted.
Fixes #29: #291 parent 9ff1341 commit 2892e9a
1 file changed
+30
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1029 | 1045 | | |
1030 | 1046 | | |
1031 | 1047 | | |
1032 | 1048 | | |
| 1049 | + | |
1033 | 1050 | | |
| 1051 | + | |
1034 | 1052 | | |
1035 | 1053 | | |
1036 | 1054 | | |
| |||
1050 | 1068 | | |
1051 | 1069 | | |
1052 | 1070 | | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
| 1071 | + | |
| 1072 | + | |
1060 | 1073 | | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1061 | 1081 | | |
1062 | 1082 | | |
1063 | 1083 | | |
1064 | 1084 | | |
1065 | 1085 | | |
1066 | 1086 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | 1087 | | |
1081 | 1088 | | |
1082 | 1089 | | |
| |||
0 commit comments