rpms/latex2rtf/devel latex2rtf-imgh.patch, NONE, 1.1 latex2rtf.spec, 1.4, 1.5

Jussi Lehtola jussilehtola at fedoraproject.org
Mon Apr 27 10:40:16 UTC 2009


Author: jussilehtola

Update of /cvs/pkgs/rpms/latex2rtf/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30396/devel

Modified Files:
	latex2rtf.spec 
Added Files:
	latex2rtf-imgh.patch 
Log Message:
* Mon Apr 27 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 1.9.19-8
- Fix image height problem on 64-bit architectures.


latex2rtf-imgh.patch:

--- NEW FILE latex2rtf-imgh.patch ---
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 <ctype.h>
 #include <limits.h>
 #include <math.h>
+#include <stdint.h>
 #ifdef UNIX
 #include <unistd.h>
 #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;


Index: latex2rtf.spec
===================================================================
RCS file: /cvs/pkgs/rpms/latex2rtf/devel/latex2rtf.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- latex2rtf.spec	24 Mar 2009 22:22:18 -0000	1.4
+++ latex2rtf.spec	27 Apr 2009 10:39:46 -0000	1.5
@@ -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 @@
 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 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p0
 chmod a-x cfg/*.cfg
 
 %build
@@ -80,8 +84,13 @@
 
 
 %changelog
+* Mon Apr 27 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 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 <jussi.lehtola at iki.fi> - 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 <jussi.lehtola at iki.fi> - 1.9.19-6
 - Fix EPEL build.




More information about the fedora-extras-commits mailing list