Hello community,
here is the log from the commit of package libspectre for openSUSE:Factory
checked in at Fri Feb 6 18:04:32 CET 2009.
--------
--- libspectre/libspectre.changes 2008-10-23 15:44:36.000000000 +0200
+++ libspectre/libspectre.changes 2009-02-05 04:13:25.000000000 +0100
@@ -1,0 +2,11 @@
+Thu Feb 5 04:11:47 CET 2009 - vuntz(a)novell.com
+
+- Update to version 0.2.2:
+ + A problem when rendering some documents where the page size is
+ different from the Bounding Box has been fixed (fdo#18239)
+ + Parser is now locale-independent when parsing float numbers
+ (fdo#18685)
+ + The display format has been fixed to match cairo/pixman.
+ (fdo#18266)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libspectre-0.2.1.tar.bz2
New:
----
libspectre-0.2.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libspectre.spec ++++++
--- /var/tmp/diff_new_pack.vSd538/_old 2009-02-06 18:03:29.000000000 +0100
+++ /var/tmp/diff_new_pack.vSd538/_new 2009-02-06 18:03:29.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package libspectre (Version 0.2.1)
+# spec file for package libspectre (Version 0.2.2)
#
-# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2009 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
@@ -23,8 +23,8 @@
License: GPL v2 or later
Group: Development/Libraries/C and C++
Summary: Library for Rendering PostScript Documents
-Version: 0.2.1
-Release: 2
+Version: 0.2.2
+Release: 1
Source0: %name-%version.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires libspectre1 = %{version}-%{release}
@@ -110,6 +110,14 @@
%_libdir/pkgconfig/libspectre.pc
%changelog
+* Thu Feb 05 2009 vuntz(a)novell.com
+- Update to version 0.2.2:
+ + A problem when rendering some documents where the page size is
+ different from the Bounding Box has been fixed (fdo#18239)
+ + Parser is now locale-independent when parsing float numbers
+ (fdo#18685)
+ + The display format has been fixed to match cairo/pixman.
+ (fdo#18266)
* Wed Oct 22 2008 mrueckert(a)suse.de
- fix debug_packages_requires define
* Wed Oct 15 2008 stbinner(a)suse.de
++++++ libspectre-0.2.1.tar.bz2 -> libspectre-0.2.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/ChangeLog new/libspectre-0.2.2/ChangeLog
--- old/libspectre-0.2.1/ChangeLog 2008-08-10 16:29:47.000000000 +0200
+++ new/libspectre-0.2.2/ChangeLog 2008-11-25 17:20:20.000000000 +0100
@@ -1,3 +1,99 @@
+commit b3886dd89f7a3394eed2c9e574909646b6024197
+Author: Alexander Myltsev <avm(a)altlinux.org>
+Date: Mon Nov 24 09:21:13 2008 +0300
+
+ ps.c: malloc + memset -> calloc
+
+ libspectre/ps.c | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+commit 52fa52f93943a6154cf2ac9b473d6b4948d75a15
+Author: Alexander Myltsev <avm(a)altlinux.org>
+Date: Mon Nov 24 07:58:55 2008 +0300
+
+ spectre-device.c: fix warning.
+
+ libspectre/spectre-device.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+commit 397266cb2a209122c34b8c0f57e63b45f6924b22
+Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
+Date: Tue Nov 25 15:31:37 2008 +0100
+
+ Parse floats in a locale-independent way
+
+ Fixes bug #18685. Instead of using %f when parsing floats with
+ sscanf %s is used, and the resulting string is then converted
+ to a float by using _spectre_strtod which is locale-independent.
+
+ libspectre/ps.c | 57 ++++++++++++++++++++++++++++++------------------------
+ 1 files changed, 32 insertions(+), 25 deletions(-)
+
+commit deded1a671fd8d76ed9920efa9747912bdcd01df
+Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
+Date: Tue Nov 25 15:28:59 2008 +0100
+
+ Add _spectre_strtod to spectre utils
+
+ Copied from glib g_strtod(), a thread-safe locale-independent version
+ of the standard strtod().
+
+ libspectre/spectre-utils.c | 124 ++++++++++++++++++++++++++++++++++++++++++++
+ libspectre/spectre-utils.h | 18 ++++---
+ 2 files changed, 134 insertions(+), 8 deletions(-)
+
+commit 1e1c9ae337489aef9b8d2db77c615ad18e29bec1
+Author: Alexander Myltsev <avm(a)altlinux.org>
+Date: Tue Nov 25 14:57:01 2008 +0100
+
+ ps.c: extract the scan_boundingbox function.
+
+ libspectre/ps.c | 167 ++++++++++++++-----------------------------------------
+ 1 files changed, 41 insertions(+), 126 deletions(-)
+
+commit afc775659bb577a059a3e8b33cb3849a7f2075df
+Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
+Date: Mon Nov 24 19:59:18 2008 +0100
+
+ Only translate when the page box is the bounding box
+
+ Fixes bug #18239
+
+ libspectre/spectre-gs.c | 53 +++++++++++++++++++++++------------------------
+ 1 files changed, 26 insertions(+), 27 deletions(-)
+
+commit 3daba8d3926d816bdfdb205ddd3b0a69f869125e
+Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
+Date: Mon Nov 24 19:58:23 2008 +0100
+
+ Add a (private) function to get the BoundingBox of a page
+
+ libspectre/ps.c | 58 ++++++++++++++++++++++++++++++++++++-------------------
+ libspectre/ps.h | 11 ++++++++++
+ 2 files changed, 49 insertions(+), 20 deletions(-)
+
+commit e72e663cf333a88ec0dcfc3b8aaf79c93a783295
+Author: Chris Wilson <chris(a)chris-wilson.co.uk>
+Date: Tue Oct 28 12:10:46 2008 +0000
+
+ Ensure row-alignment match pixman's requirments
+
+ pixman requires a row-alignment of 4 bytes, so we need to inform gs to
+ create a memory device matching that requirement.
+
+ libspectre/spectre-device.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit 22a3be83641df53dbbb81c8c6f3e072d4eb72624
+Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
+Date: Sun Aug 10 16:31:33 2008 +0200
+
+ Update for release 0.2.1
+
+ NEWS | 25 +++++++++++++++++++++++++
+ configure.ac | 4 ++--
+ 2 files changed, 27 insertions(+), 2 deletions(-)
+
commit 3529b5d06b30ee88b431cdf216cc48088bc83a13
Author: Carlos Garcia Campos <carlosgc(a)gnome.org>
Date: Sat Aug 9 16:24:18 2008 +0200
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/configure new/libspectre-0.2.2/configure
--- old/libspectre-0.2.1/configure 2008-08-10 16:29:05.000000000 +0200
+++ new/libspectre-0.2.2/configure 2008-11-25 17:24:10.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libspectre 0.2.1.
+# Generated by GNU Autoconf 2.61 for libspectre 0.2.2.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@
# Identity of this package.
PACKAGE_NAME='libspectre'
PACKAGE_TARNAME='libspectre'
-PACKAGE_VERSION='0.2.1'
-PACKAGE_STRING='libspectre 0.2.1'
+PACKAGE_VERSION='0.2.2'
+PACKAGE_STRING='libspectre 0.2.2'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -1409,7 +1409,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libspectre 0.2.1 to adapt to many kinds of systems.
+\`configure' configures libspectre 0.2.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1479,7 +1479,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libspectre 0.2.1:";;
+ short | recursive ) echo "Configuration of libspectre 0.2.2:";;
esac
cat <<\_ACEOF
@@ -1589,7 +1589,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libspectre configure 0.2.1
+libspectre configure 0.2.2
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1603,7 +1603,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libspectre $as_me 0.2.1, which was
+It was created by libspectre $as_me 0.2.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2296,7 +2296,7 @@
# Define the identity of the package.
PACKAGE='libspectre'
- VERSION='0.2.1'
+ VERSION='0.2.2'
cat >>confdefs.h <<_ACEOF
@@ -2476,7 +2476,7 @@
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=1
+LT_REVISION=2
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -2495,8 +2495,8 @@
SPECTRE_MAJOR_VERSION=0
SPECTRE_MINOR_VERSION=2
-SPECTRE_MICRO_VERSION=1
-SPECTRE_VERSION=0.2.1
+SPECTRE_MICRO_VERSION=2
+SPECTRE_VERSION=0.2.2
@@ -22194,7 +22194,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libspectre $as_me 0.2.1, which was
+This file was extended by libspectre $as_me 0.2.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22247,7 +22247,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libspectre config.status 0.2.1
+libspectre config.status 0.2.2
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/configure.ac new/libspectre-0.2.2/configure.ac
--- old/libspectre-0.2.1/configure.ac 2008-08-10 16:27:55.000000000 +0200
+++ new/libspectre-0.2.2/configure.ac 2008-11-25 17:18:41.000000000 +0100
@@ -2,7 +2,7 @@
m4_define([spectre_major_version], [0])
m4_define([spectre_minor_version], [2])
-m4_define([spectre_micro_version], [1])
+m4_define([spectre_micro_version], [2])
m4_define([spectre_version],
[spectre_major_version.spectre_minor_version.spectre_micro_version])
@@ -23,7 +23,7 @@
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=1
+LT_REVISION=2
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/ps.c new/libspectre-0.2.2/libspectre/ps.c
--- old/libspectre-0.2.1/libspectre/ps.c 2008-08-09 16:23:38.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/ps.c 2008-11-25 16:18:18.000000000 +0100
@@ -207,6 +207,43 @@
static char *skipped_line = "% ps_io_fgetchars: skipped line";
static char *empty_string = "";
+static Boolean scan_boundingbox(int *bb, const char *line)
+{
+ char fllx[21], flly[21], furx[21], fury[21];
+
+ if (sscanf (line, "%d %d %d %d",
+ &bb[LLX], &bb[LLY], &bb[URX], &bb[URY]) == 4)
+ return True;
+
+ if (sscanf (line, "%20s %20s %20s %20s",
+ fllx, flly, furx, fury) == 4) {
+ float ffllx, fflly, ffurx, ffury;
+
+ ffllx = _spectre_strtod (fllx, NULL);
+ fflly = _spectre_strtod (flly, NULL);
+ ffurx = _spectre_strtod (furx, NULL);
+ ffury = _spectre_strtod (fury, NULL);
+
+ bb[LLX] = ffllx;
+ bb[LLY] = fflly;
+ bb[URX] = ffurx;
+ bb[URY] = ffury;
+
+ if (bb[LLX] > ffllx)
+ bb[LLX]--;
+ if (bb[LLY] > fflly)
+ bb[LLY]--;
+ if (bb[URX] < ffurx)
+ bb[URX]++;
+ if (bb[URY] < ffury)
+ bb[URY]++;
+
+ return True;
+ }
+
+ return False;
+}
+
/*--------------------------------------------------*/
/*
@@ -425,9 +462,8 @@
if ((iscomment(line,"%!PS") || iscomment(line, "\004%!PS"))) {
INFMESSAGE(found "PS-Adobe-" comment)
- doc = (struct document *) PS_malloc(sizeof(struct document));
+ doc = (struct document *) PS_calloc(1, sizeof(struct document));
CHECK_MALLOCED(doc);
- memset(doc, 0, sizeof(struct document));
/* ignore possible leading ^D */
if (*line == '\004') {
@@ -462,9 +498,8 @@
In a way, this makes sense, a program PostScript does not need
the !PS at the beginning.
*/
- doc = (struct document *) PS_malloc(sizeof(struct document));
+ doc = (struct document *) PS_calloc(1, sizeof(struct document));
CHECK_MALLOCED(doc);
- memset(doc, 0, sizeof(struct document));
doc->ref_count = 1;
doc->filename = _spectre_strdup (filename);
doc->default_page_orientation = NONE;
@@ -502,31 +537,9 @@
if (strcmp(text, "(atend)") == 0) {
bb_set = ATEND;
} else {
- if (sscanf(line+length("%%BoundingBox:"), "%d %d %d %d",
- &(doc->boundingbox[LLX]),
- &(doc->boundingbox[LLY]),
- &(doc->boundingbox[URX]),
- &(doc->boundingbox[URY])) == 4)
+ if (scan_boundingbox(doc->boundingbox,
+ line + length("%%BoundingBox:")))
bb_set = 1;
- else {
- float fllx, flly, furx, fury;
- if (sscanf(line+length("%%BoundingBox:"), "%f %f %f %f",
- &fllx, &flly, &furx, &fury) == 4) {
- bb_set = 1;
- doc->boundingbox[LLX] = fllx;
- doc->boundingbox[LLY] = flly;
- doc->boundingbox[URX] = furx;
- doc->boundingbox[URY] = fury;
- if (fllx < doc->boundingbox[LLX])
- doc->boundingbox[LLX]--;
- if (flly < doc->boundingbox[LLY])
- doc->boundingbox[LLY]--;
- if (furx > doc->boundingbox[URX])
- doc->boundingbox[URX]++;
- if (fury > doc->boundingbox[URY])
- doc->boundingbox[URY]++;
- }
- }
}
} else if (orientation_set == NONE &&
iscomment(line+2, "Orientation:")) {
@@ -592,16 +605,16 @@
}
} else if (doc->nummedia == NONE &&
iscomment(line+2, "DocumentMedia:")) {
- float w, h;
+ char w[21], h[21];
doc->media = (Media)
PS_malloc(sizeof (MediaStruct));
CHECK_MALLOCED(doc->media);
doc->media[0].name = ps_gettext(line+length("%%DocumentMedia:"),
&next_char);
if (doc->media[0].name != NULL) {
- if (sscanf(next_char, "%f %f", &w, &h) == 2) {
- doc->media[0].width = w + 0.5;
- doc->media[0].height = h + 0.5;
+ if (sscanf(next_char, "%20s %20s", w, h) == 2) {
+ doc->media[0].width = _spectre_strtod (w, NULL) + 0.5;
+ doc->media[0].height = _spectre_strtod (h, NULL) + 0.5;
}
if (doc->media[0].width != 0 && doc->media[0].height != 0)
doc->nummedia = 1;
@@ -620,9 +633,9 @@
doc->media[doc->nummedia].name = ps_gettext(line+length("%%+"),
&next_char);
if (doc->media[doc->nummedia].name != NULL) {
- if (sscanf(next_char, "%f %f", &w, &h) == 2) {
- doc->media[doc->nummedia].width = w + 0.5;
- doc->media[doc->nummedia].height = h + 0.5;
+ if (sscanf(next_char, "%20s %20s", w, h) == 2) {
+ doc->media[doc->nummedia].width = _spectre_strtod (w, NULL) + 0.5;
+ doc->media[doc->nummedia].height = _spectre_strtod (h, NULL) + 0.5;
}
if (doc->media[doc->nummedia].width != 0 &&
doc->media[doc->nummedia].height != 0) doc->nummedia++;
@@ -806,31 +819,9 @@
PS_free(cp);
} else if (page_bb_set == NONE &&
iscomment(line+2, "PageBoundingBox:")) {
- if (sscanf(line+length("%%PageBoundingBox:"), "%d %d %d %d",
- &(doc->default_page_boundingbox[LLX]),
- &(doc->default_page_boundingbox[LLY]),
- &(doc->default_page_boundingbox[URX]),
- &(doc->default_page_boundingbox[URY])) == 4)
+ if (scan_boundingbox(doc->default_page_boundingbox,
+ line+length("%%PageBoundingBox:")))
page_bb_set = 1;
- else {
- float fllx, flly, furx, fury;
- if (sscanf(line+length("%%PageBoundingBox:"), "%f %f %f %f",
- &fllx, &flly, &furx, &fury) == 4) {
- page_bb_set = 1;
- doc->default_page_boundingbox[LLX] = fllx;
- doc->default_page_boundingbox[LLY] = flly;
- doc->default_page_boundingbox[URX] = furx;
- doc->default_page_boundingbox[URY] = fury;
- if (fllx < doc->default_page_boundingbox[LLX])
- doc->default_page_boundingbox[LLX]--;
- if (flly < doc->default_page_boundingbox[LLY])
- doc->default_page_boundingbox[LLY]--;
- if (furx > doc->default_page_boundingbox[URX])
- doc->default_page_boundingbox[URX]++;
- if (fury > doc->default_page_boundingbox[URY])
- doc->default_page_boundingbox[URY]++;
- }
- }
}
}
section_len += line_len;
@@ -936,31 +927,9 @@
PS_free(cp);
} else if (page_bb_set == NONE &&
iscomment(line+2, "PageBoundingBox:")) {
- if (sscanf(line+length("%%PageBoundingBox:"), "%d %d %d %d",
- &(doc->default_page_boundingbox[LLX]),
- &(doc->default_page_boundingbox[LLY]),
- &(doc->default_page_boundingbox[URX]),
- &(doc->default_page_boundingbox[URY])) == 4)
+ if (scan_boundingbox(doc->default_page_boundingbox,
+ line+length("%%PageBoundingBox:")))
page_bb_set = 1;
- else {
- float fllx, flly, furx, fury;
- if (sscanf(line+length("%%PageBoundingBox:"), "%f %f %f %f",
- &fllx, &flly, &furx, &fury) == 4) {
- page_bb_set = 1;
- doc->default_page_boundingbox[LLX] = fllx;
- doc->default_page_boundingbox[LLY] = flly;
- doc->default_page_boundingbox[URX] = furx;
- doc->default_page_boundingbox[URY] = fury;
- if (fllx < doc->default_page_boundingbox[LLX])
- doc->default_page_boundingbox[LLX]--;
- if (flly < doc->default_page_boundingbox[LLY])
- doc->default_page_boundingbox[LLY]--;
- if (furx > doc->default_page_boundingbox[URX])
- doc->default_page_boundingbox[URX]++;
- if (fury > doc->default_page_boundingbox[URY])
- doc->default_page_boundingbox[URY]++;
- }
- }
}
}
section_len += line_len;
@@ -1103,38 +1072,10 @@
if (strcmp(text, "(atend)") == 0 || strcmp(text, "atend") == 0) {
page_bb_set = ATEND;
} else {
- if (sscanf(line+length("%%PageBoundingBox:"), "%d %d %d %d",
- &(doc->pages[doc->numpages].boundingbox[LLX]),
- &(doc->pages[doc->numpages].boundingbox[LLY]),
- &(doc->pages[doc->numpages].boundingbox[URX]),
- &(doc->pages[doc->numpages].boundingbox[URY])) == 4)
- {
- if (page_bb_set == NONE) page_bb_set = 1;
- }
- else {
- float fllx, flly, furx, fury;
- if (sscanf(line+length("%%PageBoundingBox:"),
- "%f %f %f %f",
- &fllx, &flly, &furx, &fury) == 4) {
- if (page_bb_set == NONE) page_bb_set = 1;
- doc->pages[doc->numpages].boundingbox[LLX] = fllx;
- doc->pages[doc->numpages].boundingbox[LLY] = flly;
- doc->pages[doc->numpages].boundingbox[URX] = furx;
- doc->pages[doc->numpages].boundingbox[URY] = fury;
- if (fllx <
- doc->pages[doc->numpages].boundingbox[LLX])
- doc->pages[doc->numpages].boundingbox[LLX]--;
- if (flly <
- doc->pages[doc->numpages].boundingbox[LLY])
- doc->pages[doc->numpages].boundingbox[LLY]--;
- if (furx >
- doc->pages[doc->numpages].boundingbox[URX])
- doc->pages[doc->numpages].boundingbox[URX]++;
- if (fury >
- doc->pages[doc->numpages].boundingbox[URY])
- doc->pages[doc->numpages].boundingbox[URY]++;
- }
- }
+ if (scan_boundingbox(doc->pages[doc->numpages].boundingbox,
+ line+length("%%PageBoundingBox:")))
+ if(page_bb_set == NONE)
+ page_bb_set = 1;
}
}
}
@@ -1191,28 +1132,7 @@
doc->begintrailer = position;
section_len = line_len;
} else if (bb_set == ATEND && iscomment(line+2, "BoundingBox:")) {
- if (sscanf(line+length("%%BoundingBox:"), "%d %d %d %d",
- &(doc->boundingbox[LLX]),
- &(doc->boundingbox[LLY]),
- &(doc->boundingbox[URX]),
- &(doc->boundingbox[URY])) != 4) {
- float fllx, flly, furx, fury;
- if (sscanf(line+length("%%BoundingBox:"), "%f %f %f %f",
- &fllx, &flly, &furx, &fury) == 4) {
- doc->boundingbox[LLX] = fllx;
- doc->boundingbox[LLY] = flly;
- doc->boundingbox[URX] = furx;
- doc->boundingbox[URY] = fury;
- if (fllx < doc->boundingbox[LLX])
- doc->boundingbox[LLX]--;
- if (flly < doc->boundingbox[LLY])
- doc->boundingbox[LLY]--;
- if (furx > doc->boundingbox[URX])
- doc->boundingbox[URX]++;
- if (fury > doc->boundingbox[URY])
- doc->boundingbox[URY]++;
- }
- }
+ scan_boundingbox(doc->boundingbox, line + length("%%BoundingBox:"));
} else if (orientation_set == ATEND &&
iscomment(line+2, "Orientation:")) {
sscanf(line+length("%%Orientation:"), "%256s", text);
@@ -2280,6 +2200,42 @@
return doseps->ps_begin + doseps->ps_length;
}
+int
+psgetpagebbox (const struct document *doc, int page, int *urx, int *ury, int *llx, int *lly)
+{
+ int new_llx = 0;
+ int new_lly = 0;
+ int new_urx = 0;
+ int new_ury = 0;
+
+ if ((page >= 0) &&
+ (doc->pages) &&
+ (doc->pages[page].boundingbox[URX] >
+ doc->pages[page].boundingbox[LLX]) &&
+ (doc->pages[page].boundingbox[URY] >
+ doc->pages[page].boundingbox[LLY])) {
+ /* use page bbox */
+ new_llx = doc->pages[page].boundingbox[LLX];
+ new_lly = doc->pages[page].boundingbox[LLY];
+ new_urx = doc->pages[page].boundingbox[URX];
+ new_ury = doc->pages[page].boundingbox[URY];
+ } else if ((doc->boundingbox[URX] > doc->boundingbox[LLX]) &&
+ (doc->boundingbox[URY] > doc->boundingbox[LLY])) {
+ /* use doc bbox */
+ new_llx = doc->boundingbox[LLX];
+ new_lly = doc->boundingbox[LLY];
+ new_urx = doc->boundingbox[URX];
+ new_ury = doc->boundingbox[URY];
+ }
+
+ *llx = new_llx;
+ *lly = new_lly;
+ *urx = new_urx;
+ *ury = new_ury;
+
+ return (new_llx != 0 && new_lly != 0 && new_urx != 0 && new_ury != 0);
+}
+
/* From Evince */
#define DEFAULT_PAGE_SIZE 1
@@ -2301,7 +2257,7 @@
* or the page bbox (if specified)
* or the bounding box
*/
- if ((page >= 0) && (doc->numpages > (unsigned int)page) &&
+ if ((page >= 0) && (doc->numpages > (unsigned int)page) &&
(doc->pages) && (doc->pages[page].media)) {
new_pagesize = doc->pages[page].media - doc->media;
} else if (doc->default_page_media != NULL) {
@@ -2323,25 +2279,7 @@
/* Compute bounding box */
if (doc && (doc->epsf || new_pagesize == -1)) { /* epsf or bbox */
- if ((page >= 0) &&
- (doc->pages) &&
- (doc->pages[page].boundingbox[URX] >
- doc->pages[page].boundingbox[LLX]) &&
- (doc->pages[page].boundingbox[URY] >
- doc->pages[page].boundingbox[LLY])) {
- /* use page bbox */
- new_llx = doc->pages[page].boundingbox[LLX];
- new_lly = doc->pages[page].boundingbox[LLY];
- new_urx = doc->pages[page].boundingbox[URX];
- new_ury = doc->pages[page].boundingbox[URY];
- } else if ((doc->boundingbox[URX] > doc->boundingbox[LLX]) &&
- (doc->boundingbox[URY] > doc->boundingbox[LLY])) {
- /* use doc bbox */
- new_llx = doc->boundingbox[LLX];
- new_lly = doc->boundingbox[LLY];
- new_urx = doc->boundingbox[URX];
- new_ury = doc->boundingbox[URY];
- }
+ psgetpagebbox (doc, page, &new_urx, &new_ury, &new_llx, &new_lly);
} else {
if (new_pagesize < 0)
new_pagesize = DEFAULT_PAGE_SIZE;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/ps.h new/libspectre-0.2.2/libspectre/ps.h
--- old/libspectre-0.2.1/libspectre/ps.h 2008-08-04 12:31:17.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/ps.h 2008-11-23 16:05:06.000000000 +0100
@@ -179,6 +179,17 @@
#endif
);
+int psgetpagebbox (
+#if NeedFunctionPrototypes
+ const struct document *,
+ int,
+ int *,
+ int *,
+ int *,
+ int *
+#endif
+);
+
void psgetpagebox (
#if NeedFunctionPrototypes
const struct document *,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/spectre-device.c new/libspectre-0.2.2/libspectre/spectre-device.c
--- old/libspectre-0.2.1/libspectre/spectre-device.c 2008-07-13 18:04:14.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/spectre-device.c 2008-11-25 16:15:50.000000000 +0100
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include "spectre-device.h"
#include "spectre-gs.h"
@@ -229,6 +230,7 @@
args[arg++] = dsp_format = _spectre_strdup_printf ("-dDisplayFormat=%d",
DISPLAY_COLORS_RGB |
DISPLAY_DEPTH_8 |
+ DISPLAY_ROW_ALIGN_32 |
#ifdef WORDS_BIGENDIAN
DISPLAY_UNUSED_FIRST |
DISPLAY_BIGENDIAN |
@@ -238,7 +240,7 @@
#endif
DISPLAY_TOPFIRST);
args[arg++] = dsp_handle = _spectre_strdup_printf ("-sDisplayHandle=16#%llx",
- (unsigned long long int)device);
+ (uintptr_t)device);
if (rc->use_platform_fonts == FALSE)
args[arg++] = "-dNOPLATFONTS";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/spectre-gs.c new/libspectre-0.2.2/libspectre/spectre-gs.c
--- old/libspectre-0.2.1/libspectre/spectre-gs.c 2008-08-06 10:55:46.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/spectre-gs.c 2008-11-23 16:24:44.000000000 +0100
@@ -209,39 +209,36 @@
int x,
int y)
{
- int doc_llx = 0, doc_lly = 0;
- int page_llx = 0, page_lly = 0;
-
- if ((doc->boundingbox[URX] > doc->boundingbox[LLX]) &&
- (doc->boundingbox[URY] > doc->boundingbox[LLY])) {
- doc_llx = doc->boundingbox[LLX];
- doc_lly = doc->boundingbox[LLY];
- }
-
- if (doc->numpages > 0 &&
- (doc->pages[page_index].boundingbox[URX] >
- doc->pages[page_index].boundingbox[LLX]) &&
- (doc->pages[page_index].boundingbox[URY] >
- doc->pages[page_index].boundingbox[LLY])) {
- /* Do not translate twice */
- if (doc->pages[page_index].boundingbox[LLX] != doc_llx &&
- doc->pages[page_index].boundingbox[LLY] != doc_lly) {
- page_llx = doc->pages[page_index].boundingbox[LLX];
- page_lly = doc->pages[page_index].boundingbox[LLY];
+ int xoffset = 0, yoffset = 0;
+ int page_urx, page_ury, page_llx, page_lly;
+ int bbox_urx, bbox_ury, bbox_llx, bbox_lly;
+ int doc_xoffset = 0, doc_yoffset = 0;
+ int page_xoffset = 0, page_yoffset = 0;
+
+ if (psgetpagebbox (doc, page_index, &bbox_urx, &bbox_ury, &bbox_llx, &bbox_lly)) {
+ psgetpagebox (doc, page_index,
+ &page_urx, &page_ury,
+ &page_llx, &page_lly);
+ if ((bbox_urx - bbox_llx) == (page_urx - page_llx) ||
+ (bbox_ury - bbox_lly) == (page_ury - page_lly)) {
+ /* BoundingBox */
+ xoffset = page_llx;
+ yoffset = page_lly;
}
}
if (doc->numpages > 0) {
- page_llx += x;
- page_lly += y;
+ page_xoffset = xoffset + x;
+ page_yoffset = yoffset + y;
} else {
- doc_llx += x;
- doc_lly += y;
+ doc_xoffset = xoffset + x;
+ doc_yoffset = yoffset + y;
}
-
+
if (!spectre_gs_process (gs,
doc->filename,
- doc_llx, doc_lly,
+ doc_xoffset,
+ doc_yoffset,
doc->beginprolog,
doc->endprolog))
return FALSE;
@@ -262,7 +259,8 @@
for (i = 0; i < page_index; i++) {
if (!spectre_gs_process (gs,
doc->filename,
- 0, 0,
+ page_xoffset,
+ page_yoffset,
doc->pages[i].begin,
doc->pages[i].end))
return FALSE;
@@ -271,7 +269,8 @@
if (!spectre_gs_process (gs,
doc->filename,
- page_llx, page_lly,
+ page_xoffset,
+ page_yoffset,
doc->pages[page_index].begin,
doc->pages[page_index].end))
return FALSE;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/spectre-utils.c new/libspectre-0.2.2/libspectre/spectre-utils.c
--- old/libspectre-0.2.1/libspectre/spectre-utils.c 2008-08-07 13:26:14.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/spectre-utils.c 2008-11-25 14:36:23.000000000 +0100
@@ -22,6 +22,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
+#include <locale.h>
#include "spectre-utils.h"
@@ -250,3 +252,125 @@
return (((int)(unsigned char) *s1) - ((int)(unsigned char) *s2));
}
+
+#define ascii_isspace(c) \
+ (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
+#define ascii_isdigit(c) \
+ (c >= '0' && c <= '9')
+
+/* This function behaves like the standard strtod() function
+ * does in the C locale. It does this without actually changing
+ * the current locale, since that would not be thread-safe.
+ * A limitation of the implementation is that this function
+ * will still accept localized versions of infinities and NANs.
+ */
+double
+_spectre_strtod (const char *nptr,
+ char **endptr)
+{
+ char *fail_pos;
+ double val;
+ struct lconv *locale_data;
+ const char *decimal_point;
+ int decimal_point_len;
+ const char *p, *decimal_point_pos;
+ const char *end = NULL; /* Silence gcc */
+ int strtod_errno;
+
+ fail_pos = NULL;
+
+ locale_data = localeconv ();
+ decimal_point = locale_data->decimal_point;
+ decimal_point_len = strlen (decimal_point);
+
+ decimal_point_pos = NULL;
+ end = NULL;
+
+ if (decimal_point[0] != '.' || decimal_point[1] != 0) {
+ p = nptr;
+ /* Skip leading space */
+ while (ascii_isspace (*p))
+ p++;
+
+ /* Skip leading optional sign */
+ if (*p == '+' || *p == '-')
+ p++;
+
+ if (ascii_isdigit (*p) || *p == '.') {
+ while (ascii_isdigit (*p))
+ p++;
+
+ if (*p == '.')
+ decimal_point_pos = p++;
+
+ while (ascii_isdigit (*p))
+ p++;
+
+ if (*p == 'e' || *p == 'E')
+ p++;
+ if (*p == '+' || *p == '-')
+ p++;
+ while (ascii_isdigit (*p))
+ p++;
+
+ end = p;
+ }
+ /* For the other cases, we need not convert the decimal point */
+ }
+
+ if (decimal_point_pos) {
+ char *copy, *c;
+
+ /* We need to convert the '.' to the locale specific decimal point */
+ copy = (char *) malloc (end - nptr + 1 + decimal_point_len);
+
+ c = copy;
+ memcpy (c, nptr, decimal_point_pos - nptr);
+ c += decimal_point_pos - nptr;
+ memcpy (c, decimal_point, decimal_point_len);
+ c += decimal_point_len;
+ memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1));
+ c += end - (decimal_point_pos + 1);
+ *c = 0;
+
+ errno = 0;
+ val = strtod (copy, &fail_pos);
+ strtod_errno = errno;
+
+ if (fail_pos) {
+ if (fail_pos - copy > decimal_point_pos - nptr)
+ fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1);
+ else
+ fail_pos = (char *)nptr + (fail_pos - copy);
+ }
+
+ free (copy);
+ } else if (end) {
+ char *copy;
+
+ copy = (char *) malloc (end - (char *)nptr + 1);
+ memcpy (copy, nptr, end - nptr);
+ *(copy + (end - (char *)nptr)) = 0;
+
+ errno = 0;
+ val = strtod (copy, &fail_pos);
+ strtod_errno = errno;
+
+ if (fail_pos) {
+ fail_pos = (char *)nptr + (fail_pos - copy);
+ }
+
+ free (copy);
+ } else {
+ errno = 0;
+ val = strtod (nptr, &fail_pos);
+ strtod_errno = errno;
+ }
+
+ if (endptr)
+ *endptr = fail_pos;
+
+ errno = strtod_errno;
+
+ return val;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/spectre-utils.h new/libspectre-0.2.2/libspectre/spectre-utils.h
--- old/libspectre-0.2.1/libspectre/spectre-utils.h 2008-08-07 13:31:57.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/spectre-utils.h 2008-11-25 14:22:13.000000000 +0100
@@ -121,14 +121,16 @@
#endif /* SPECTRE_DISABLE_CHECKS */
/* String handling helpers */
-char *_spectre_strdup_printf (const char *format,
- ...);
-char *_spectre_strdup (const char *str);
-int _spectre_strncasecmp (const char *s1,
- const char *s2,
- size_t n);
-int _spectre_strcasecmp (const char *s1,
- const char *s2);
+char *_spectre_strdup_printf (const char *format,
+ ...);
+char *_spectre_strdup (const char *str);
+int _spectre_strncasecmp (const char *s1,
+ const char *s2,
+ size_t n);
+int _spectre_strcasecmp (const char *s1,
+ const char *s2);
+double _spectre_strtod (const char *nptr,
+ char **endptr);
SPECTRE_END_DECLS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/libspectre/spectre-version.h new/libspectre-0.2.2/libspectre/spectre-version.h
--- old/libspectre-0.2.1/libspectre/spectre-version.h 2008-08-10 16:29:13.000000000 +0200
+++ new/libspectre-0.2.2/libspectre/spectre-version.h 2008-11-25 17:24:18.000000000 +0100
@@ -27,11 +27,11 @@
#define SPECTRE_MAJOR_VERSION 0
#define SPECTRE_MINOR_VERSION 2
-#define SPECTRE_MICRO_VERSION 1
+#define SPECTRE_MICRO_VERSION 2
-#define SPECTRE_VERSION_STRING "0.2.1"
+#define SPECTRE_VERSION_STRING "0.2.2"
-#define SPECTRE_VERSION ((0 << 16) | (2 << 8) | (1))
+#define SPECTRE_VERSION ((0 << 16) | (2 << 8) | (2))
SPECTRE_END_DECLS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libspectre-0.2.1/NEWS new/libspectre-0.2.2/NEWS
--- old/libspectre-0.2.1/NEWS 2008-08-10 16:25:16.000000000 +0200
+++ new/libspectre-0.2.2/NEWS 2008-11-25 17:13:49.000000000 +0100
@@ -1,3 +1,17 @@
+libspectre 0.2.2 (25 November 2008)
+===================================
+
+This is another bugfix only release in the libspectre's 0.2 series.
+
+A problem when rendering some documents where the page size is
+different from the Bounding Box has been fixed (Bug #18239)
+
+Parser is now locale-independent when parsing float numbers (Bug #18685)
+
+The display format has been fixed to match cairo/pixman. Thanks to
+Chris Wilson (Bug #18266)
+
+
libspectre 0.2.1 (10 August 2008)
=================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org