From 8de30f6ab1e544296f5d4570ca0313521b492d8e012baf0c4acbf3e51346ea18 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 7 Feb 2013 16:27:43 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Publishing/transfig?expand=0&rev=25 --- transfig.3.2.5d-mediaboxrealnb.dif | 33 ++++++++++++++++++++++++++++++ transfig.spec | 8 +++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 transfig.3.2.5d-mediaboxrealnb.dif diff --git a/transfig.3.2.5d-mediaboxrealnb.dif b/transfig.3.2.5d-mediaboxrealnb.dif new file mode 100644 index 0000000..4d24d0b --- /dev/null +++ b/transfig.3.2.5d-mediaboxrealnb.dif @@ -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; diff --git a/transfig.spec b/transfig.spec index 2fb749e..9f139be 100644 --- a/transfig.spec +++ b/transfig.spec @@ -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