]> www.fi.muni.cz Git - evince.git/commitdiff
Bump requirements to libspectre 0.2.0. Fixes bug #507705.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 13 Jan 2008 11:23:44 +0000 (11:23 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 13 Jan 2008 11:23:44 +0000 (11:23 +0000)
2008-01-13  Carlos Garcia Campos  <carlosgc@gnome.org>
* configure.ac:
* backend/dvi/cairo-device.c: (dvi_cairo_draw_ps):
* backend/ps/ev-spectre.c: (ps_document_render):
Bump requirements to libspectre 0.2.0. Fixes bug #507705.

svn path=/trunk/; revision=2816

ChangeLog
backend/dvi/cairo-device.c
backend/ps/ev-spectre.c
configure.ac

index f0939039c120714cc138fff513ffabadee7dd095..9994b618ec1da189e35670fe545b864d05a32fa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-13  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * configure.ac:
+       * backend/dvi/cairo-device.c: (dvi_cairo_draw_ps):
+       * backend/ps/ev-spectre.c: (ps_document_render):
+
+       Bump requirements to libspectre 0.2.0. Fixes bug #507705. 
+
 2008-01-04  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.c (ev_transition_animation_fade)
index 95f3e63ae8abaa55cbb4fa3bb34166fd02e51614..b8ec39e6877c904b8a9ff0f69635a52c8ce6c362 100644 (file)
@@ -135,8 +135,8 @@ dvi_cairo_draw_ps (DviContext *dvi,
        unsigned char        *data = NULL;
        int                   row_length;
        SpectreDocument      *psdoc;
-       SpectrePage          *page;
        SpectreRenderContext *rc;
+       int                   w, h;
        SpectreStatus         status;
        cairo_surface_t      *image;
 
@@ -148,24 +148,24 @@ dvi_cairo_draw_ps (DviContext *dvi,
                spectre_document_free (psdoc);
                return;
        }
-       
-       page = spectre_document_get_page (psdoc, 0);
-       if (!page) {
-               spectre_document_free (psdoc);
-               return;
-       }
+
+       spectre_document_get_page_size (psdoc, &w, &h);
 
        rc = spectre_render_context_new ();
-       spectre_render_context_set_page_size (rc, width, height);
-       spectre_page_render (page, rc, &data, &row_length);
-       status = spectre_page_status (page);
-       spectre_render_context_free (rc);
+       spectre_render_context_set_scale (rc,
+                                         (double)width / w,
+                                         (double)height / h);
+       spectre_document_render_full (psdoc, rc, &data, &row_length);   
+       status = spectre_document_status (psdoc);
 
-       spectre_page_free (page);
+       spectre_render_context_free (rc);
        spectre_document_free (psdoc);
 
        if (status) {
+               g_warning ("Error rendering PS document %s: %s\n",
+                          filename, spectre_status_to_string (status));
                free (data);
+               
                return;
        }
 
index 41553df225c01e668089ce4ee59e70bfd6aa1c5c..1252b8d2faa18c07b7dc9c51b747d4ad4d0d44f5 100644 (file)
@@ -289,7 +289,9 @@ ps_document_render (EvDocument      *document,
        rotation = (rc->rotation + get_page_rotation (ps_page)) % 360;
 
        src = spectre_render_context_new ();
-       spectre_render_context_set_page_size (src, width, height);
+       spectre_render_context_set_scale (src,
+                                         (gdouble)width / width_points,
+                                         (gdouble)height / height_points);
        spectre_render_context_set_rotation (src, rotation);
        spectre_page_render (ps_page, src, &data, &stride);
        spectre_render_context_free (src);
index 7c50c967f90cf40cba2adb30bb8e8f8142b7fc32..afd29edc39b45856409e91ec8edb036fc441b3af 100644 (file)
@@ -261,9 +261,10 @@ fi
 
 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
 dnl ================== end of pdf checks ============================================
+SPECTRE_REQUIRED=0.2.0
 
 dnl libspectre (used by ps and dvi backends)
-PKG_CHECK_MODULES(SPECTRE, libspectre,have_spectre=yes,have_spectre=no)
+PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
 AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
 if test "x$have_spectre" = "xyes"; then
    AC_DEFINE([HAVE_SPECTRE], [1], [Have libpectre])
@@ -285,7 +286,7 @@ if test x$enable_ps = xyes; then
       GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
       AC_MSG_RESULT(found $GS_VERSION)
       if test "$GS_VERSION" -lt "7"; then
-        AC_MSG_WARN([PS support is disabled since libspectre or Ghostscript (version >= 7) are needed])
+        AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) or Ghostscript (version >= 7) are needed])
         enable_ps=no
       else
          AC_ARG_WITH(gs-aa-params,