- Fix downscaling of rotated pages (#563353)
This commit is contained in:
parent
c1e66b82f3
commit
eb65c693ba
59
poppler-0.12.3-rotated-downscale.patch
Normal file
59
poppler-0.12.3-rotated-downscale.patch
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
|
||||||
|
index 5ca86b8..a2a9ae5 100644
|
||||||
|
--- a/poppler/CairoOutputDev.cc
|
||||||
|
+++ b/poppler/CairoOutputDev.cc
|
||||||
|
@@ -1344,6 +1344,30 @@ void CairoOutputDev::endMaskClip(GfxState *state) {
|
||||||
|
clearSoftMask(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
+/* Taken from cairo/doc/tutorial/src/singular.c */
|
||||||
|
+static void
|
||||||
|
+get_singular_values (const cairo_matrix_t *matrix,
|
||||||
|
+ double *major,
|
||||||
|
+ double *minor)
|
||||||
|
+{
|
||||||
|
+ double xx = matrix->xx, xy = matrix->xy;
|
||||||
|
+ double yx = matrix->yx, yy = matrix->yy;
|
||||||
|
+
|
||||||
|
+ double a = xx*xx+yx*yx;
|
||||||
|
+ double b = xy*xy+yy*yy;
|
||||||
|
+ double k = xx*xy+yx*yy;
|
||||||
|
+
|
||||||
|
+ double f = (a+b) * .5;
|
||||||
|
+ double g = (a-b) * .5;
|
||||||
|
+ double delta = sqrt (g*g + k*k);
|
||||||
|
+
|
||||||
|
+ if (major)
|
||||||
|
+ *major = sqrt (f + delta);
|
||||||
|
+ if (minor)
|
||||||
|
+ *minor = sqrt (f - delta);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
cairo_surface_t *CairoOutputDev::downscaleSurface(cairo_surface_t *orig_surface) {
|
||||||
|
cairo_surface_t *dest_surface;
|
||||||
|
unsigned char *dest_buffer;
|
||||||
|
@@ -1356,12 +1380,21 @@ cairo_surface_t *CairoOutputDev::downscaleSurface(cairo_surface_t *orig_surface)
|
||||||
|
if (printing)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
+
|
||||||
|
+ orig_width = cairo_image_surface_get_width (orig_surface);
|
||||||
|
+ orig_height = cairo_image_surface_get_height (orig_surface);
|
||||||
|
+
|
||||||
|
cairo_matrix_t matrix;
|
||||||
|
cairo_get_matrix(cairo, &matrix);
|
||||||
|
|
||||||
|
/* this whole computation should be factored out */
|
||||||
|
- double xScale = matrix.xx;
|
||||||
|
- double yScale = matrix.yy;
|
||||||
|
+ double xScale;
|
||||||
|
+ double yScale;
|
||||||
|
+ if (orig_width > orig_height)
|
||||||
|
+ get_singular_values (&matrix, &xScale, &yScale);
|
||||||
|
+ else
|
||||||
|
+ get_singular_values (&matrix, &yScale, &xScale);
|
||||||
|
+
|
||||||
|
int tx, tx2, ty, ty2; /* the integer co-oridinates of the resulting image */
|
||||||
|
int scaledHeight;
|
||||||
|
int scaledWidth;
|
@ -2,7 +2,7 @@
|
|||||||
Summary: PDF rendering library
|
Summary: PDF rendering library
|
||||||
Name: poppler
|
Name: poppler
|
||||||
Version: 0.12.3
|
Version: 0.12.3
|
||||||
Release: 8%{?dist}
|
Release: 9%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
URL: http://poppler.freedesktop.org/
|
URL: http://poppler.freedesktop.org/
|
||||||
@ -18,6 +18,9 @@ Patch100: poppler-0.12.1-objstream.patch
|
|||||||
Patch101: poppler-0.12.3-downscale.patch
|
Patch101: poppler-0.12.3-downscale.patch
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=533992
|
# https://bugzilla.redhat.com/show_bug.cgi?id=533992
|
||||||
Patch102: poppler-0.12.3-actualize-fcconfig.patch
|
Patch102: poppler-0.12.3-actualize-fcconfig.patch
|
||||||
|
# http://bugs.freedesktop.org/show_bug.cgi?id=26264
|
||||||
|
# http://bugzilla.redhat.com/show_bug.cgi?id=563353
|
||||||
|
Patch103: poppler-0.12.3-rotated-downscale.patch
|
||||||
|
|
||||||
Requires: poppler-data >= 0.4.0
|
Requires: poppler-data >= 0.4.0
|
||||||
BuildRequires: automake libtool
|
BuildRequires: automake libtool
|
||||||
@ -125,6 +128,7 @@ converting PDF files to a number of other formats.
|
|||||||
%patch100 -p1 -b .objstream
|
%patch100 -p1 -b .objstream
|
||||||
%patch101 -p1 -b .downscale
|
%patch101 -p1 -b .downscale
|
||||||
%patch102 -p1 -b .fcconfig
|
%patch102 -p1 -b .fcconfig
|
||||||
|
%patch103 -p1 -b .rotated-downscale
|
||||||
|
|
||||||
chmod -x goo/GooTimer.h
|
chmod -x goo/GooTimer.h
|
||||||
|
|
||||||
@ -228,6 +232,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 16 2010 Marek Kasik <mkasik@redhat.com> - 0.12.3-9
|
||||||
|
- Fix downscaling of rotated pages (#563353)
|
||||||
|
|
||||||
* Thu Jan 28 2010 Marek Kasik <mkasik@redhat.com> - 0.12.3-8
|
* Thu Jan 28 2010 Marek Kasik <mkasik@redhat.com> - 0.12.3-8
|
||||||
- Get current FcConfig before using it (#533992)
|
- Get current FcConfig before using it (#533992)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user