This commit is contained in:
Zdenek Dohnal 2023-04-27 14:33:20 +02:00
parent 82826d262c
commit 2672a39650
5 changed files with 33 additions and 44 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/libppd-2.0b3.tar.gz
/libppd-2.0b4.tar.gz
/libppd-2.0rc1.tar.gz

View File

@ -1,38 +0,0 @@
From b815415c74a8e5112ca9bd8adc7c04f626ec4702 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Wed, 15 Mar 2023 16:37:06 +0100
Subject: [PATCH] ppd-filter.c: Generate media-col if media-col-default exists
We would generate `media-col` attribute only if we had `media-col-default`
attribute and `PageSize` or `media` options, which doesn't seem to be always
the case for `PageSize` and `media`. These options usually are not
default options and if the application doesn't send them, they are not
sent to filters.
The current implementation breaks image printing for (at least) printers
installed with Postscript driver - the printer outputs an empty sheet of
paper. It happens because `cfFilterImageToPDF()` doesn't get page size
by other means.
---
ppd/ppd-filter.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ppd/ppd-filter.c b/ppd/ppd-filter.c
index 308336ad..fbf2e4f8 100644
--- a/ppd/ppd-filter.c
+++ b/ppd/ppd-filter.c
@@ -739,9 +739,8 @@ ppdFilterLoadPPD(cf_filter_data_t *data) // I/O - Job and printer data
page_size = cupsGetOption("PageSize", data->num_options, data->options);
media = cupsGetOption("media", data->num_options, data->options);
- if ((page_size || media) &&
- (attr = ippFindAttribute(data->printer_attrs, "media-col-default",
- IPP_TAG_ZERO)) != NULL)
+ if ((attr = ippFindAttribute(data->printer_attrs, "media-col-default",
+ IPP_TAG_ZERO)) != NULL)
{
// We have already applied the settings of these options to the
// PPD file and converted the PPD option settings into the printer
--
2.40.0

View File

@ -0,0 +1,20 @@
diff --git a/Makefile.am b/Makefile.am
index 4bb9472b..21a2fb45 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -143,6 +143,7 @@ EXTRA_DIST += \
ppd/test2.ppd \
ppd/README.md
+if ENABLE_TESTPPDFILE
# ================
# PPD test utility
# ================
@@ -159,6 +160,7 @@ testppdfile_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS) \
$(LIBCUPSFILTERS_CFLAGS)
+endif
# ===========================
# ppdc PPD compiler utilities

View File

@ -1,14 +1,14 @@
%global _hardened_build 1
%global upstream_version 2.0b4
%global upstream_version 2.0rc1
# don't build libppd-tools until CUPS 3.x drops them
%bcond_with tools
Name: libppd
Epoch: 1
Version: 2.0~b4
Release: 2%{?dist}
Version: 2.0~rc1
Release: 1%{?dist}
Summary: Library for retro-fitting legacy printer drivers
# the CUPS exception text is the same as LLVM exception, so using that name with
@ -20,8 +20,8 @@ Source0: %{URL}/releases/download/%{upstream_version}/%{name}-%{upstream_
# Patches
# https://github.com/OpenPrinting/libppd/pull/15
Patch0001: 0001-ppd-filter.c-Generate-media-col-if-media-col-default.patch
# https://github.com/OpenPrinting/libppd/pull/18
Patch0001: libppd-disable-testppdfile.patch
# for autogen.sh
@ -116,8 +116,10 @@ PPD files from *.drv files.
--disable-static\
%if %{with tools}
--enable-ppdc-utils\
--enable-testppdfile\
%else
--disable-ppdc-utils\
--disable-testppdfile\
%endif
--with-pdftops=hybrid
@ -181,6 +183,7 @@ rm -rf %{buildroot}%{_datadir}/ppdc
%{_bindir}/ppdi
%{_bindir}/ppdmerge
%{_bindir}/ppdpo
%{_bindir}/testppdfile
%dir %{_datadir}/ppdc/
%{_datadir}/ppdc/epson.h
%{_datadir}/ppdc/font.defs
@ -191,6 +194,9 @@ rm -rf %{buildroot}%{_datadir}/ppdc
%endif
%changelog
* Thu Apr 27 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc1-1
- 2.0rc1
* Wed Mar 15 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~b4-2
- fix printing images to Postscript printers

View File

@ -1 +1 @@
SHA512 (libppd-2.0b4.tar.gz) = 0bfa70c829b3ee20b7ea889c557a668175c44aec524fbc29e5f293f2f2156cc23027a4e087963dbdbbbf7c642ecb9a6a568ebfd449176d5047deb38422de47a9
SHA512 (libppd-2.0rc1.tar.gz) = 78623394adecc4eb03438719a0aae8bfabca884f5f0e114431ebb6206beabbfa5ae4d9363d6b3a514b34ae77b2d6626e6fb6fdbf4f1dccdcc65813b0f0b9370a