From 20d8d8625f214e059c163a8b8de57d9553c6eeed Mon Sep 17 00:00:00 2001 From: John Ellson Date: Mon, 21 Oct 2013 21:02:02 -0400 Subject: [PATCH] striving for loadimage consistency,,, --- lib/gvc/gvusershape.c | 6 +++--- loadimage_test.sh | 6 ++++-- plugin/poppler/gvloadimage_poppler.c | 7 +------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/gvc/gvusershape.c b/lib/gvc/gvusershape.c index 611f6267e..880a0350a 100644 --- a/lib/gvc/gvusershape.c +++ b/lib/gvc/gvusershape.c @@ -236,7 +236,7 @@ static void svg_size (usershape_t *us) } } } - us->dpi = 72; + us->dpi = 0; us->w = w; us->h = h; } @@ -411,7 +411,7 @@ static void ps_size (usershape_t *us) int lx, ly, ux, uy; char* linep; - us->dpi = POINTS_PER_INCH; + us->dpi = 0; fseek(us->f, 0, SEEK_SET); saw_bb = FALSE; while (fgets(line, sizeof(line), us->f)) { @@ -537,7 +537,7 @@ static void pdf_size (usershape_t *us) { boxf bb; - us->dpi = POINTS_PER_INCH; + us->dpi = 0; fseek(us->f, 0, SEEK_SET); if ( ! bboxPDF (us->f, &bb)) { us->x = bb.LL.x; diff --git a/loadimage_test.sh b/loadimage_test.sh index e6fb3ed23..794044405 100644 --- a/loadimage_test.sh +++ b/loadimage_test.sh @@ -11,12 +11,14 @@ FORMATS="\ -Tpdf:cairo:cairo \ -Tico:cairo:gdk" -echo "digraph { ranksep=2; hello -> world }" >hello.gv +echo "digraph { ranksep=\"1.5\"; hello -> world }" >hello.gv dot hello.gv -v -Gmargin="0" $FORMATS -O ( - echo "digraph { rankdir=LR; node [shape=box]" +# echo "digraph { rankdir=LR; dpi=300" + echo "digraph { rankdir=LR" + echo " node [fontsize=9 shape=box width=\"0.1\"]" edge="" chain="" for f in $FORMATS; do diff --git a/plugin/poppler/gvloadimage_poppler.c b/plugin/poppler/gvloadimage_poppler.c index 860dea55e..0497b34d4 100644 --- a/plugin/poppler/gvloadimage_poppler.c +++ b/plugin/poppler/gvloadimage_poppler.c @@ -130,12 +130,7 @@ static void gvloadimage_poppler_cairo(GVJ_t * job, usershape_t *us, boxf b, bool cairo_save(cr); -// FIXME -#define IMAGE_DPI 72 - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - IMAGE_DPI*(us->w)/72.0, - IMAGE_DPI*(us->h)/72.0); - + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, us->w, us->h); cairo_surface_reference(surface); cairo_set_source_surface(cr, surface, 0, 0); -- 2.40.0