+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)
unsigned char *data = NULL;
int row_length;
SpectreDocument *psdoc;
- SpectrePage *page;
SpectreRenderContext *rc;
+ int w, h;
SpectreStatus status;
cairo_surface_t *image;
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;
}
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);
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])
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,