SHA256
1
0
forked from pool/transfig
Dr. Werner Fink 2013-02-07 16:27:43 +00:00 committed by Git OBS Bridge
parent 7b41917290
commit 8de30f6ab1
2 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,33 @@
--- fig2dev/dev/readeps.c
+++ fig2dev/dev/readeps.c 2013-02-07 16:18:36.233452627 +0000
@@ -79,12 +79,20 @@ read_eps_pdf(file, filetype, pic, llx, l
if (pdf_flag) {
if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */
c = strchr(buf,'[')+1;
- if (c && sscanf(c,"%d %d %d %d",llx,lly,&urx,&ury) < 4) {
+ if (c && sscanf(c,%lf %lf %lf %lf",
+ &fllx, &flly, &furx, &fury) < 4) {
*llx = *lly = 0;
urx = paperdef[0].width*72;
ury = paperdef[0].height*72;
put_msg("Bad MediaBox in imported PDF file %s, assuming %s size",
pic->file, metric? "A4" : "Letter" );
+ } else {
+ *llx = (int) floor(fllx);
+ *lly = (int) floor(flly);
+ urx = (int) floor(furx);
+ ury = (int) floor(fury);
+ pic->bit_size.x = (int) (furx-fllx);
+ pic->bit_size.y = (int) (fury-flly);
}
}
/* look for bounding box for EPS file */
@@ -101,6 +109,8 @@ read_eps_pdf(file, filetype, pic, llx, l
}
*llx = (int) floor(fllx);
*lly = (int) floor(flly);
+ urx = (int) floor(furx);
+ ury = (int) floor(fury);
pic->bit_size.x = (int) (furx-fllx);
pic->bit_size.y = (int) (fury-flly);
break;

View File

@ -1,7 +1,7 @@
#
# spec file for package transfig
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -50,6 +50,7 @@ Group: Productivity/Graphics/Convertors
Source: transfig.%{version}.tar.bz2
Patch0: transfig.3.2.5d.dif
Patch2: transfig.3.2.5-binderman.dif
Patch3: transfig.3.2.5d-mediaboxrealnb.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_exec_prefix" == "/usr/X11R6"
@ -85,8 +86,9 @@ Authors:
%prep
%setup -q -n transfig.%{version}
%patch0 -b .0
%patch2 -b .bm
%patch0 -p0 -b .0
%patch2 -p0 -b .bm
%patch3 -p0 -b .mbox
xmkmf -a -D_DATA='%{_data}'
%build