diff --git a/latex2rtf-imgh.patch b/latex2rtf-imgh.patch new file mode 100644 index 0000000..f8ff569 --- /dev/null +++ b/latex2rtf-imgh.patch @@ -0,0 +1,67 @@ +Fix wrong height of pictures on x86_64 + +On 64-bit Fedora latex2rtf produced RTFs with insanely large pictures. +The dimensions of a PNG are stored in the header as 4-byte values. +GetPngSize() reads them as consecutive unsigned longs. +The problem is that sizeof(unsigned long) != 4 bytes. It's 8 bytes on +x86_64 Linux. +Use standard ISO C uint32_t instead. +With this patch the figures have their normal size. + +Index: graphics.c +=================================================================== +--- graphics.c (revision 894) ++++ graphics.c (working copy) +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #ifdef UNIX + #include + #endif +@@ -755,7 +756,7 @@ + + static unsigned char * getPngChunk(FILE *fp, char *s) + { +- unsigned long size, crc; ++ uint32_t size, crc; + char head[5]; + unsigned char *data; + +@@ -777,7 +778,7 @@ + + if (strcmp(head,"IEND") == 0) return NULL; + +- diagnostics(6,"found chunk '%s' size %ld bytes",head,size); ++ diagnostics(6,"found chunk '%s' size %ld bytes",head,(unsigned long)size); + data = malloc(size); + if (data == NULL) return NULL; + +@@ -798,7 +799,7 @@ + static void GetPngSize(char *s, unsigned long *w, unsigned long *h, unsigned long *xres, unsigned long *yres, int *bad_res) + { + FILE *fp; +- unsigned long *p; ++ uint32_t *p; + unsigned char buffer[16]; + char reftag[9] = "\211PNG\r\n\032\n"; + unsigned char *data = NULL; +@@ -833,7 +834,7 @@ + return; + } + +- p = (unsigned long *) data; ++ p = (uint32_t *) data; + *w = (g_little_endian) ? LETONL(*p) : *p; + p++; + *h = (g_little_endian) ? LETONL(*p) : *p; +@@ -846,7 +847,7 @@ + return; + } + +- p = (unsigned long *) data; ++ p = (uint32_t *) data; + *xres = (g_little_endian) ? LETONL(*p) : *p; + p++; + *yres = (g_little_endian) ? LETONL(*p) : *p; diff --git a/latex2rtf.spec b/latex2rtf.spec index 115f4cd..4353034 100644 --- a/latex2rtf.spec +++ b/latex2rtf.spec @@ -1,6 +1,6 @@ Name: latex2rtf Version: 1.9.19 -Release: 7%{?dist} +Release: 8%{?dist} Summary: LaTeX to RTF converter that handles equations, figures, and cross-references Group: Applications/File License: GPLv2+ @@ -8,6 +8,9 @@ URL: http://latex2rtf.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz # Patch to makefile changing man and info file locations and compiler flags Patch0: latex2rtf.patch +# Patch to fix wrong height of images on 64-bit architectures +# Bug https://bugzilla.redhat.com/attachment.cgi?id=341372 +Patch1: latex2rtf-imgh.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # For running the tests @@ -33,6 +36,7 @@ Word for Windows and Word for Macintosh). %prep %setup -q %patch0 -p1 +%patch1 -p0 chmod a-x cfg/*.cfg %build @@ -80,8 +84,13 @@ fi %changelog +* Mon Apr 27 2009 Jussi Lehtola - 1.9.19-8 +- Added patch to fix image height on 64-bit architectures. + https://bugzilla.redhat.com/show_bug.cgi?id=497752 + * Wed Mar 25 2009 Jussi Lehtola - 1.9.19-7 -- Retry EPEL fix: disable check phase which doesn't seem to work for some reason on EPEL 5 ppc (segfault in list.tex). +- Retry EPEL fix: disable check phase which doesn't seem to work + for some reason on EPEL 5 ppc (segfault in list.tex). * Sun Mar 22 2009 Jussi Lehtola - 1.9.19-6 - Fix EPEL build.