rpms/cups/FC-6 cups-str2348.patch,NONE,1.1 cups.spec,1.329,1.330
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed May 9 13:08:41 UTC 2007
Author: twaugh
Update of /cvs/dist/rpms/cups/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv12693
Modified Files:
cups.spec
Added Files:
cups-str2348.patch
Log Message:
* Wed May 9 2007 Tim Waugh <twaugh at redhat.com> 1:1.2.10-6
- Applied fix for rotated PDFs (bug #236753, STR #2348).
- Resolves: rhbz#236753
cups-str2348.patch:
PSOutputDev.cxx | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
--- NEW FILE cups-str2348.patch ---
--- cups-1.2.10/pdftops/PSOutputDev.cxx.str2348 2007-02-05 20:25:50.000000000 +0000
+++ cups-1.2.10/pdftops/PSOutputDev.cxx 2007-05-09 13:20:13.000000000 +0100
@@ -1159,7 +1159,14 @@
}
// Tell CUPS pstops filter not to do its own rotation...
- writePSFmt("%%cupsRotation: %d\n", pageRotate);
+ int cups_rotate = 0;
+ int width = (int)ceil(mediaBox->x2 - mediaBox->x1);
+ int height = (int)ceil(mediaBox->y2 - mediaBox->y1);
+ int imgWidth = (int)ceil(cropBox->x2 - cropBox->x1);
+
+ if (width > height && width > imgWidth) cups_rotate = 90;
+
+ writePSFmt("%%cupsRotation: %d\n", cups_rotate);
writePSFmt("%%Producer: xpdf/pdftops %s\n", xpdfVersion);
xref->getDocInfo(&info);
@@ -2511,17 +2518,19 @@
landscape = gFalse;
} else {
rotate = (360 - state->getRotate()) % 360;
+
+ fprintf(stderr, "DEBUG: Page rotate=%d, width=%d, height=%d, imgWidth=%d, imgHeight=%d\n",
+ state->getRotate(), width, height, imgWidth, imgHeight);
+
if (rotate == 0 || rotate == 180) {
- if ((width > height && imgWidth < imgHeight) ||
- (height > width && imgHeight < imgWidth)) {
+ if (width > height && width > imgWidth) {
rotate += 90;
landscape = gTrue;
} else {
landscape = gFalse;
}
} else { // rotate == 90 || rotate == 270
- if ((width > height && imgWidth < imgHeight) ||
- (height > width && imgHeight < imgWidth)) {
+ if (height > width && height > imgWidth) {
rotate = 270 - rotate;
landscape = gTrue;
} else {
@@ -2529,6 +2538,7 @@
}
}
}
+
writePSFmt("%%%%PageOrientation: %s\n",
landscape ? "Landscape" : "Portrait");
writePS("pdfStartPage\n");
Index: cups.spec
===================================================================
RCS file: /cvs/dist/rpms/cups/FC-6/cups.spec,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -r1.329 -r1.330
--- cups.spec 25 Apr 2007 17:12:47 -0000 1.329
+++ cups.spec 9 May 2007 13:08:38 -0000 1.330
@@ -6,7 +6,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.2.10
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -49,6 +49,7 @@
Patch23: cups-str2323.patch
Patch24: cups-str2109.patch
Patch25: cups-usb-paperout.patch
+Patch26: cups-str2348.patch
Patch100: cups-lspp.patch
Epoch: 1
Url: http://www.cups.org/
@@ -159,6 +160,7 @@
%patch23 -p1 -b .str2323
%patch24 -p1 -b .str2109
%patch25 -p1 -b .usb-paperout
+%patch26 -p1 -b .str2348
%if %lspp
%patch100 -p1 -b .lspp
@@ -442,6 +444,9 @@
%{cups_serverbin}/daemon/cups-lpd
%changelog
+* Wed May 9 2007 Tim Waugh <twaugh at redhat.com> 1:1.2.10-6
+- Applied fix for rotated PDFs (bug #236753, STR #2348).
+
* Wed Apr 25 2007 Tim Waugh <twaugh at redhat.com> 1:1.2.10-5
- Until bug #236736 is fixed, work around the kernel usblp driver's
quirks so that we can detect paper-out conditions.
More information about the fedora-cvs-commits
mailing list