rpms/poppler/F-12 poppler-0.12.3-fdo#5589.patch, NONE, 1.1 poppler.spec, 1.107, 1.108
Rex Dieter
rdieter at fedoraproject.org
Tue Jan 19 18:41:31 UTC 2010
- Previous message: File nicotine+-1.2.14.tar.bz2 uploaded to lookaside cache by melmorabity
- Next message: rpms/nicotine+/devel import.log, NONE, 1.1 nicotine+-1.2.14-commands.patch, NONE, 1.1 nicotine+-1.2.14-desktop.patch, NONE, 1.1 nicotine+-1.2.14-glade_install.patch, NONE, 1.1 nicotine+-1.2.14-guide.patch, NONE, 1.1 nicotine+.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: rdieter
Update of /cvs/pkgs/rpms/poppler/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13348
Modified Files:
poppler.spec
Added Files:
poppler-0.12.3-fdo#5589.patch
Log Message:
* Tue Jan 19 2010 Rex Dieter <rdieter at fedoraproject.org> - 0.12.3-5
- cairo backend, scale images correctly (#556549, fdo#5589)
poppler-0.12.3-fdo#5589.patch:
CairoOutputDev.cc | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 101 insertions(+), 7 deletions(-)
--- NEW FILE poppler-0.12.3-fdo#5589.patch ---
diff -up poppler-0.12.3/poppler/CairoOutputDev.cc.rex poppler-0.12.3/poppler/CairoOutputDev.cc
--- poppler-0.12.3/poppler/CairoOutputDev.cc.rex 2009-12-24 04:41:22.000000000 -0600
+++ poppler-0.12.3/poppler/CairoOutputDev.cc 2010-01-19 12:14:33.210386122 -0600
@@ -97,6 +97,69 @@ void CairoImage::setImage (cairo_surface
this->image = cairo_surface_reference (image);
}
+// basic 2D box filter
+void PrescaleARGB(unsigned int * source,int width,int height,int stride,unsigned int * dest,int scaledWidth,int scaledHeight,int scaledStride)
+{
+ stride/=4;
+ scaledStride/=4;
+ // sanity check
+ if (scaledHeight>height || scaledWidth>width || scaledHeight<=0 || scaledWidth<=0 || stride<width || scaledStride<scaledWidth) return;
+ if (source==NULL || dest==NULL) return;
+
+ unsigned int * pLine,*pt;
+
+ int x,y,z;
+ unsigned int sum1,sum2,sum3,sum4;
+ int sx,sy,oy;
+ int count,dx,dy;
+
+ // calculate pixelwidths
+ int * pixelwidth=new int[scaledWidth];
+ int n,l=0;
+ for(x=0;x<scaledWidth;x++)
+ {
+ n=((x+1)*width-1)/scaledWidth;
+ pixelwidth[x]=n-l;
+ // assert(pixelwidth[x]);
+ l=n;
+ }
+
+ pLine=source;
+ oy=0;
+ for(y=0;y<scaledHeight;y++)
+ { // column
+ z=y*scaledStride;
+ pLine=source+oy*stride;
+ n=((y+1)*height-1)/scaledHeight;
+ dy=n-oy;
+ for(x=0;x<scaledWidth;x++)
+ { // row
+ dx=pixelwidth[x];
+ pt=pLine; // temp storage line pointer
+ sum1=sum2=sum3=sum4=0;
+ for(sy=0;sy<dy;sy++)
+ { // sum y
+ for(sx=0;sx<dx;sx++)
+ { // sum x
+ sum1+=pLine[sx]&0xFF;
+ sum2+=(pLine[sx]>>8)&0xFF;
+ sum3+=(pLine[sx]>>16)&0xFF;
+ sum4+=pLine[sx]>>24;
+ } // sum x
+ pLine+=stride;
+ } // sum y
+ pLine=pt+dx;
+ count=dx*dy;
+ dest[z++]=sum1/count+(sum2/count<<8)+(sum3/count<<16)+(sum4/count<<24);
+ } // row
+ oy+=dy;
+ }
+
+ delete [] pixelwidth;
+}
+
+
+
//------------------------------------------------------------------------
// CairoOutputDev
//------------------------------------------------------------------------
@@ -1975,13 +2038,40 @@ void CairoOutputDev::drawImage(GfxState
((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
#endif
+ int scaledWidth,scaledHeight,scaledStride;
+ unsigned char * scaledBuffer;
+
+ cairo_get_matrix(cairo, &matrix);
+ scaledWidth=fabs(matrix.xx+matrix.yx)+0.5;
+ scaledHeight=fabs(matrix.xy+matrix.yy)+0.5;
+
+ if (printing || scaledWidth>=width || scaledHeight>=height)
+ { // no prescaling => render directly to cairo_image
+ scaledWidth=width;
+ scaledHeight=height;
+ }
+ else
+ { // first render to ARGB buffer then downsample to cairo_image
+ stride = width*4;
+ buffer = new unsigned char [stride*height];
+ }
+
image = cairo_image_surface_create (maskColors ?
CAIRO_FORMAT_ARGB32 :
CAIRO_FORMAT_RGB24,
- width, height);
+ scaledWidth, scaledHeight);
if (cairo_surface_status (image))
goto cleanup;
+
+ scaledBuffer = cairo_image_surface_get_data (image);
+ scaledStride = cairo_image_surface_get_stride (image);
+ if (scaledWidth>=width || scaledHeight>=height)
+ { // no prescaling => render directly to cairo_image
+ stride = scaledStride;
+ buffer = scaledBuffer;
+ }
+
// special case for one-channel (monochrome/gray/separation) images:
// build a lookup table here
if (colorMap->getNumPixelComps() == 1) {
@@ -1994,11 +2084,9 @@ void CairoOutputDev::drawImage(GfxState
pix = (Guchar)i;
colorMap->getRGB(&pix, &lookup[i]);
- }
- }
+ }
+ }
- buffer = cairo_image_surface_get_data (image);
- stride = cairo_image_surface_get_stride (image);
for (int y = 0; y < height; y++) {
uint32_t *dest = (uint32_t *) (buffer + y * stride);
Guchar *pix = imgStr->getLine();
@@ -2040,6 +2128,12 @@ void CairoOutputDev::drawImage(GfxState
}
gfree(lookup);
+ if (scaledWidth<width)
+ {
+ PrescaleARGB((unsigned int *)buffer,width,height,stride,(unsigned int *)scaledBuffer,scaledWidth,scaledHeight,scaledStride);
+ delete [] buffer;
+ }
+
cairo_surface_mark_dirty (image);
pattern = cairo_pattern_create_for_surface (image);
cairo_surface_destroy (image);
@@ -2053,8 +2147,8 @@ void CairoOutputDev::drawImage(GfxState
CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
- cairo_matrix_init_translate (&matrix, 0, height);
- cairo_matrix_scale (&matrix, width, -height);
+ cairo_matrix_init_translate (&matrix, 0, scaledHeight);
+ cairo_matrix_scale (&matrix, scaledWidth, -scaledHeight);
cairo_pattern_set_matrix (pattern, &matrix);
if (!mask && fill_opacity != 1.0) {
Index: poppler.spec
===================================================================
RCS file: /cvs/pkgs/rpms/poppler/F-12/poppler.spec,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -p -r1.107 -r1.108
--- poppler.spec 9 Jan 2010 23:33:23 -0000 1.107
+++ poppler.spec 19 Jan 2010 18:41:31 -0000 1.108
@@ -2,7 +2,7 @@
Summary: PDF rendering library
Name: poppler
Version: 0.12.3
-Release: 1%{?dist}
+Release: 5%{?dist}
License: GPLv2
Group: Development/Libraries
URL: http://poppler.freedesktop.org/
@@ -12,6 +12,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version
## upstreamable patches
## upstream patches
+# image scaling with cairo poor (http://bugs.freedesktop.org/show_bug.cgi?id=5589)
+# based on http://bugs.freedesktop.org/attachment.cgi?id=31924
+Patch50: poppler-0.12.3-fdo#5589.patch
# for texlive/pdftex, make ObjStream class public
Patch100: poppler-0.12.1-objstream.patch
@@ -97,13 +100,13 @@ Requires: qt4-devel
Summary: Command line utilities for converting PDF files
Group: Applications/Text
Requires: %{name} = %{version}-%{release}
-%if 0%{?fedora} < 11
+%if 0%{?fedora} < 11 && 0%{?rhel} < 6
# last seen in fc8
-Provides: pdftohtml
-Obsoletes: pdftohtml
+Provides: pdftohtml = 0.36-11
+Obsoletes: pdftohtml < 0.36-11
# last seen in fc7
-Provides: xpdf-utils = 1:3.01-27.fc7
-Obsoletes: xpdf-utils <= 1:3.01-26.fc7
+Provides: xpdf-utils = 1:3.01-27
+Obsoletes: xpdf-utils < 1:3.01-27
# even earlier?
Conflicts: xpdf <= 1:3.01-8
%endif
@@ -117,8 +120,14 @@ converting PDF files to a number of othe
%prep
%setup -q
+%patch50 -p1 -b .fdo#5589
%patch100 -p1 -b .objstream
+chmod -x goo/GooTimer.h
+
+iconv -f iso-8859-1 -t utf-8 < "utils/pdftohtml.1" > "utils/pdftohtml.1.utf8"
+mv "utils/pdftohtml.1.utf8" "utils/pdftohtml.1"
+
# hammer to nuke rpaths, recheck on new releases
autoreconf -i -f
@@ -216,6 +225,17 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue Jan 19 2010 Rex Dieter <rdieter at fedoraproject.org> - 0.12.3-5
+- cairo backend, scale images correctly (#556549, fdo#5589)
+
+* Fri Jan 15 2010 Rex Dieter <rdieter at fedoraproject.org> - 0.12.3-4
+- Sanitize versioned Obsoletes/Provides
+
+* Fri Jan 15 2010 Marek Kasik <mkasik at redhat.com> - 0.12.3-3
+- Correct permissions of goo/GooTimer.h
+- Convert pdftohtml.1 to utf8
+- Make the pdftohtml's Provides/Obsoletes versioned
+
* Thu Jan 07 2010 Rex Dieter <rdieter at fedoraproject.org> - 0.12.3-1
- poppler-0.12.3
- Previous message: File nicotine+-1.2.14.tar.bz2 uploaded to lookaside cache by melmorabity
- Next message: rpms/nicotine+/devel import.log, NONE, 1.1 nicotine+-1.2.14-commands.patch, NONE, 1.1 nicotine+-1.2.14-desktop.patch, NONE, 1.1 nicotine+-1.2.14-glade_install.patch, NONE, 1.1 nicotine+-1.2.14-guide.patch, NONE, 1.1 nicotine+.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list