Skip to content

Commit 48802f5

Browse files
committed
Fix ipptransform media handling (Issue #102)
- If "media/-col" is not specified and "print-scaling" is 'auto' or 'auto-fit', check whether input pages actually need scaling. - When not scaling a page, copy input pages using the original size.
1 parent 980bb65 commit 48802f5

File tree

16 files changed

+208
-84
lines changed

16 files changed

+208
-84
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ libcups v3.0.0 (YYYY-MM-DD)
1919
- Updated `ippfind` to use the `cupsGetClock` API.
2020
- Updated `ippeveprinter` to include all ready and supported attributes and
2121
values in the environment when processing a job.
22+
- Fixed `ipptransform` media handling to preserve input document dimensions when
23+
"media" or "media-col" are not specified (Issue #102)
2224
- Fixed `cupsJSONExport` functions with empty arrays or objects.
2325
- Fixed `httpGetDateTime` for dates in the far future (Issue #124)
2426
- Fixed input checks for `cupsCreateCredentials` and

doc/ipptransform.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,33 +316,45 @@ <h2 id="ipptransform-1.environment">Environment</h2>
316316
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_xxx</strong><br>
317317
Specifies the value of the &quot;xxx&quot; Job Template attribute, where &quot;xxx&quot; is converted to uppercase.
318318
For example, the &quot;media&quot; Job Template attribute is stored as the &quot;IPP_MEDIA&quot; environment variable.
319+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
319320
</p>
320321
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_xxx_DEFAULT</strong><br>
321322
Specifies the default value of the corresponding &quot;xxx-default&quot; Printer Description attribute, where &quot;xxx&quot; is converted to uppercase.
322323
For example, the &quot;media-default&quot; Printer Description attribute is stored as the &quot;IPP_MEDIA_DEFAULT&quot; environment variable.
324+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
325+
</p>
326+
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_xxx_READY</strong><br>
327+
Specifies the loaded value(s) of the corresponding &quot;xxx-ready&quot; Printer Status attribute, where &quot;xxx&quot; is converted to uppercase.
328+
For example, the &quot;media-ready&quot; Printer Status attribute is stored as the &quot;IPP_MEDIA_READY&quot; environment variable.
329+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
330+
</p>
331+
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_xxx_SUPPORTED</strong><br>
332+
Specifies the supported value(s) of the corresponding &quot;xxx-supported&quot; Printer Description attribute, where &quot;xxx&quot; is converted to uppercase.
333+
For example, the &quot;media-supported&quot; Printer Description attribute is stored as the &quot;IPP_MEDIA_SUPPORTED&quot; environment variable.
334+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
323335
</p>
324336
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_RASTER_BACK_SIDE</strong><br>
325337
Specifies the coordinate system of the back side of duplex sheets.
326338
The default is 'normal'.
327339
</p>
328340
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_SOURCE_RESOLUTION_SUPPORTED</strong><br>
329-
Lists the supported output resolutions.
341+
Lists the supported output resolutions, separated by commas.
330342
The default is 600dpi.
331343
</p>
332344
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PCLM_STRIP_HEIGHT_PREFERRED</strong><br>
333345
Specifies the preferred strip height for the printer.
334346
The default is 16.
335347
</p>
336348
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_RESOLUTION_SUPPORTED</strong><br>
337-
Lists the supported output resolutions.
349+
Lists the supported output resolutions, separated by commas.
338350
The default is 300dpi.
339351
</p>
340352
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_SHEET_BACK</strong><br>
341353
Specifies the coordinate system of the back side of duplex sheets.
342354
The default is 'normal'.
343355
</p>
344356
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPP_PWG_RASTER_DOCUMENT_TYPE_SUPPORTED</strong><br>
345-
Lists the supported output color spaces and bit depths.
357+
Lists the supported output color spaces and bit depths, separated by commas.
346358
The default is 'sgray_8'.
347359
</p>
348360
<p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>IPPTRANSFORM_MAX_RASTER</strong><br>
@@ -379,7 +391,7 @@ <h2 id="ipptransform-1.see-also">See Also</h2>
379391

380392
</p>
381393
<h2 id="ipptransform-1.copyright">Copyright</h2>
382-
<p>Copyright &copy; 2023-2025 by OpenPrinting.
394+
<p>Copyright &copy; 2023-2026 by OpenPrinting.
383395
Copyright &copy; 2016-2019 by the Printer Working Group.
384396
Copyright &copy; 2016-2019 by Apple Inc.
385397
</body>

man/ipptransform.1

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.\"
22
.\" ipptransform man page.
33
.\"
4-
.\" Copyright © 2023-2025 by OpenPrinting.
4+
.\" Copyright © 2023-2026 by OpenPrinting.
55
.\" Copyright © 2016-2019 by the Printer Working Group.
66
.\" Copyright © 2016-2019 by Apple Inc.
77
.\"
88
.\" Licensed under Apache License v2.0. See the file "LICENSE" for more
99
.\" information.
1010
.\"
11-
.TH ipptransform 1 "ippsample" "2025-11-24" "OpenPrinting"
11+
.TH ipptransform 1 "ippsample" "2026-01-08" "OpenPrinting"
1212
.SH NAME
1313
ipptransform \- convert document data to alternate formats
1414
.br
@@ -221,33 +221,45 @@ Specifies the title of the input file.
221221
.B IPP_xxx
222222
Specifies the value of the "xxx" Job Template attribute, where "xxx" is converted to uppercase.
223223
For example, the "media" Job Template attribute is stored as the "IPP_MEDIA" environment variable.
224+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
224225
.TP 5
225226
.B IPP_xxx_DEFAULT
226227
Specifies the default value of the corresponding "xxx-default" Printer Description attribute, where "xxx" is converted to uppercase.
227228
For example, the "media-default" Printer Description attribute is stored as the "IPP_MEDIA_DEFAULT" environment variable.
229+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
230+
.TP 5
231+
.B IPP_xxx_READY
232+
Specifies the loaded value(s) of the corresponding "xxx-ready" Printer Status attribute, where "xxx" is converted to uppercase.
233+
For example, the "media-ready" Printer Status attribute is stored as the "IPP_MEDIA_READY" environment variable.
234+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
235+
.TP 5
236+
.B IPP_xxx_SUPPORTED
237+
Specifies the supported value(s) of the corresponding "xxx-supported" Printer Description attribute, where "xxx" is converted to uppercase.
238+
For example, the "media-supported" Printer Description attribute is stored as the "IPP_MEDIA_SUPPORTED" environment variable.
239+
When the source attribute contains multiple values, they are separated by commas in the environment variable string.
228240
.TP 5
229241
.B IPP_PCLM_RASTER_BACK_SIDE
230242
Specifies the coordinate system of the back side of duplex sheets.
231243
The default is 'normal'.
232244
.TP 5
233245
.B IPP_PCLM_SOURCE_RESOLUTION_SUPPORTED
234-
Lists the supported output resolutions.
246+
Lists the supported output resolutions, separated by commas.
235247
The default is 600dpi.
236248
.TP 5
237249
.B IPP_PCLM_STRIP_HEIGHT_PREFERRED
238250
Specifies the preferred strip height for the printer.
239251
The default is 16.
240252
.TP 5
241253
.B IPP_PWG_RASTER_DOCUMENT_RESOLUTION_SUPPORTED
242-
Lists the supported output resolutions.
254+
Lists the supported output resolutions, separated by commas.
243255
The default is 300dpi.
244256
.TP 5
245257
.B IPP_PWG_RASTER_DOCUMENT_SHEET_BACK
246258
Specifies the coordinate system of the back side of duplex sheets.
247259
The default is 'normal'.
248260
.TP 5
249261
.B IPP_PWG_RASTER_DOCUMENT_TYPE_SUPPORTED
250-
Lists the supported output color spaces and bit depths.
262+
Lists the supported output color spaces and bit depths, separated by commas.
251263
The default is 'sgray_8'.
252264
.TP 5
253265
.B IPPTRANSFORM_MAX_RASTER
@@ -283,6 +295,6 @@ Convert a JPEG file to sRGB PWG Raster at 600dpi:
283295
.SH SEE ALSO
284296
.BR ipptool (1),
285297
.SH COPYRIGHT
286-
Copyright \[co] 2023-2025 by OpenPrinting.
298+
Copyright \[co] 2023-2026 by OpenPrinting.
287299
Copyright \[co] 2016-2019 by the Printer Working Group.
288300
Copyright \[co] 2016-2019 by Apple Inc.

0 commit comments

Comments
 (0)