pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

zathura-pdf-mupdf: Fix the rendering issue



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Sat Sep 29 15:42:53 2018 +0200
Changeset:	d4e70c92e2a5199a397512b9694be854bee6165b

Modified Files:
	zathura-pdf-mupdf/distinfo
	zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c
Removed Files:
	zathura-pdf-mupdf/TODO

Log Message:
zathura-pdf-mupdf: Fix the rendering issue

During the port to mupdf-1.14.0 instead of using mupdf_page->bbox due
fz_bound_page() changes a local variable was used and hence the width and height
was just 0 leading to the surprising results described in
pdf_page_render_to_buffer() described in TODO... Just use mupdf_page->bbox as it
was done.  Now zathura-pdf-mupdf works!

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d4e70c92e2a5199a397512b9694be854bee6165b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zathura-pdf-mupdf/TODO                                   | 10 ----------
 zathura-pdf-mupdf/distinfo                               |  2 +-
 zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c |  7 +++----
 3 files changed, 4 insertions(+), 15 deletions(-)

diffs:
diff --git a/zathura-pdf-mupdf/TODO b/zathura-pdf-mupdf/TODO
deleted file mode 100644
index 7499f8c9fd..0000000000
--- a/zathura-pdf-mupdf/TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-PDF are not correctly rendered... and a lot of:
-
- error: Rendering failed (page ...)
-
-errors are printed...
-
-Putting a breakpoint on pdf_page_render_to_buffer() function that
-is invoked as part of render_job() (defined in zathura)
-ZATHURA_ERROR_UNKNOWN is always returned because `image' argument
-is always NULL (hence `image == NULL' is true).
diff --git a/zathura-pdf-mupdf/distinfo b/zathura-pdf-mupdf/distinfo
index 04b11e0e5e..06bd1cd5c5 100644
--- a/zathura-pdf-mupdf/distinfo
+++ b/zathura-pdf-mupdf/distinfo
@@ -6,7 +6,7 @@ SHA512 (zathura-pdf-mupdf-0.3.3.tar.xz) = cac3ccf4f85c689d44095966fbee84efac76d7
 Size (zathura-pdf-mupdf-0.3.3.tar.xz) = 7880 bytes
 SHA1 (patch-document.c) = b7d3c8c23148f7eb5f034586c2da4995a5cf2b5d
 SHA1 (patch-meson.build) = 1ec30e3d7605a3b7bf3bccad0a38784fdfdeef3a
-SHA1 (patch-zathura-pdf-mupdf_page.c) = 2c4ef79edaa7b0d1e4dce44e382e578ba21698be
+SHA1 (patch-zathura-pdf-mupdf_page.c) = bfce420f9396025a23b7c8a78ff962b834d6746a
 SHA1 (patch-zathura-pdf-mupdf_render.c) = 8db8c49743a419a69bd33efe98114bc8878f91af
 SHA1 (patch-zathura-pdf-mupdf_search.c) = 9d21523e2768436fe2e00bc4765d21643d996c0c
 SHA1 (patch-zathura-pdf-mupdf_utils.c) = 8c1016d51a8b3be79d9398ad4588f0b93207efca
diff --git a/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c b/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c
index d826f67f1e..26b6d8fdab 100644
--- a/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c
+++ b/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_page.c
@@ -4,13 +4,12 @@ Port to mupdf-1.14.0
 
 --- zathura-pdf-mupdf/page.c.orig	2018-03-17 19:47:01.000000000 +0000
 +++ zathura-pdf-mupdf/page.c
-@@ -30,14 +30,13 @@ pdf_page_init(zathura_page_t* page)
+@@ -30,14 +30,12 @@ pdf_page_init(zathura_page_t* page)
      goto error_free;
    }
  
 -  fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page, &mupdf_page->bbox);
-+  fz_rect mediabox;
-+  mediabox = fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page);
++  mupdf_page->bbox = fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page);
  
    /* setup text */
    mupdf_page->extracted_text = false;
@@ -18,7 +17,7 @@ Port to mupdf-1.14.0
 -  fz_rect mediabox;
 -  mupdf_page->text = fz_new_stext_page(mupdf_page->ctx,
 -      fz_bound_page(mupdf_page->ctx, mupdf_page->page, &mediabox));
-+  mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mediabox);
++  mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mupdf_page->bbox);
    if (mupdf_page->text == NULL) {
      goto error_free;
    }


Home | Main Index | Thread Index | Old Index