diff --git a/kdegraphics-4.0.4-okular-fax.patch b/kdegraphics-4.0.4-okular-fax.patch new file mode 100644 index 0000000..860f21c --- /dev/null +++ b/kdegraphics-4.0.4-okular-fax.patch @@ -0,0 +1,62 @@ +--- kdegraphics/okular/generators/tiff/generator_tiff.cpp 2008/05/31 11:40:49 814835 ++++ kdegraphics/okular/generators/tiff/generator_tiff.cpp 2008/05/31 11:41:15 814836 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -47,6 +48,28 @@ + return QDateTime::fromString( QString::fromLatin1( tiffdate ), "yyyy:MM:dd HH:mm:ss" ); + } + ++static void adaptSizeToResolution( TIFF *tiff, ttag_t whichres, double dpi, uint32 *size ) ++{ ++ float resvalue = 1.0; ++ uint16 resunit = 0; ++ if ( !TIFFGetField( tiff, whichres, &resvalue ) ++ || !TIFFGetField( tiff, TIFFTAG_RESOLUTIONUNIT, &resunit ) ) ++ return; ++ ++ float newsize = *size / resvalue; ++ switch ( resunit ) ++ { ++ case RESUNIT_INCH: ++ *size = (uint32)( newsize * dpi ); ++ break; ++ case RESUNIT_CENTIMETER: ++ *size = (uint32)( newsize * 10.0 / 25.4 * dpi ); ++ break; ++ case RESUNIT_NONE: ++ break; ++ } ++} ++ + static KAboutData createAboutData() + { + KAboutData aboutData( +@@ -119,8 +142,10 @@ + if ( TIFFSetDirectory( d->tiff, mapPage( request->page()->number() ) ) ) + { + int rotation = request->page()->rotation(); +- uint32 width = (uint32)request->page()->width(); +- uint32 height = (uint32)request->page()->height(); ++ uint32 width = 1; ++ uint32 height = 1; ++ TIFFGetField( d->tiff, TIFFTAG_IMAGEWIDTH, &width ); ++ TIFFGetField( d->tiff, TIFFTAG_IMAGELENGTH, &height ); + if ( rotation % 2 == 1 ) + qSwap( width, height ); + +@@ -215,6 +240,9 @@ + TIFFGetField( d->tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 ) + continue; + ++ adaptSizeToResolution( d->tiff, TIFFTAG_XRESOLUTION, Okular::Utils::dpiX(), &width ); ++ adaptSizeToResolution( d->tiff, TIFFTAG_YRESOLUTION, Okular::Utils::dpiY(), &height ); ++ + Okular::Page * page = new Okular::Page( realdirs, width, height, Okular::Rotation0 ); + pagesVector[ realdirs ] = page; + diff --git a/kdegraphics.spec b/kdegraphics.spec index fa54168..cc5a13d 100644 --- a/kdegraphics.spec +++ b/kdegraphics.spec @@ -4,7 +4,7 @@ Summary: K Desktop Environment - Graphics Applications Epoch: 7 Version: 4.0.4 -Release: 1%{?dist} +Release: 2%{?dist} Name: kdegraphics Obsoletes: kdegraphics4 < %{version}-%{release} @@ -18,6 +18,8 @@ Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/kdegraphics-%{ Patch0: kdegraphics-4.0.1-system-libspectre.patch # necessary CMakeLists.txt changes missing in the above commit Patch1: kdegraphics-4.0.1-system-libspectre-cmake.patch +# 49134: Okular is broken for FAX, and KFAX has been removed +Patch2: kdegraphics-4.0.4-okular-fax.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: kde-filesystem >= 4 @@ -90,7 +92,7 @@ Requires: kdelibs4-devel rm -rf okular/generators/spectre/libspectre %patch1 -p1 %endif - +%patch2 -p1 -b .okular-fax %build @@ -166,6 +168,9 @@ rm -rf %{buildroot} %changelog +* Sat May 31 2008 Lukáš Tinkl 4.0.4-2 +- fix fax (TIFF) printing in okular (#449134) + * Tue May 06 2008 Rex Dieter 4.0.4-1 - kde-4.0.4