rpms/cups/devel cups-str2348.patch,NONE,1.1 cups.spec,1.329,1.330
Tim Waugh (twaugh)
fedora-extras-commits at redhat.com
Wed May 9 13:12:44 UTC 2007
Author: twaugh
Update of /cvs/pkgs/rpms/cups/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20744
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-9
- Applied fix for rotated PDFs (bug #236753, STR #2348).
cups-str2348.patch:
--- 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/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -r1.329 -r1.330
--- cups.spec 26 Apr 2007 12:50:08 -0000 1.329
+++ cups.spec 9 May 2007 13:12:09 -0000 1.330
@@ -6,7 +6,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.2.10
-Release: 8%{?dist}
+Release: 9%{?dist}
License: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -47,6 +47,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/
@@ -156,6 +157,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-9
+- Applied fix for rotated PDFs (bug #236753, STR #2348).
+
* Thu Apr 26 2007 Tim Waugh <twaugh at redhat.com> 1:1.2.10-8
- Initscript fixes (bug #237955).
More information about the fedora-extras-commits
mailing list