pkgsrc-WIP-changes archive

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

zathura-pdf-mupdf: Backport a patch from upstream to fix rendering with some PDFs



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Thu Oct 4 14:03:41 2018 +0200
Changeset:	14a4624d192933ef2695c7cdfe7b459f2acf6824

Modified Files:
	zathura-pdf-mupdf/distinfo
	zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_render.c

Log Message:
zathura-pdf-mupdf: Backport a patch from upstream to fix rendering with some PDFs

It fixes issue #1 and #2 reported upstream where some pages where correctly
rendered in MuPDF but incorrectly rendered with zathura due the use of
separations in the latter.

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

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

diffstat:
 zathura-pdf-mupdf/distinfo                             |  2 +-
 .../patches/patch-zathura-pdf-mupdf_render.c           | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs:
diff --git a/zathura-pdf-mupdf/distinfo b/zathura-pdf-mupdf/distinfo
index 278fd71d5f..a686659965 100644
--- a/zathura-pdf-mupdf/distinfo
+++ b/zathura-pdf-mupdf/distinfo
@@ -7,6 +7,6 @@ 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) = bfce420f9396025a23b7c8a78ff962b834d6746a
-SHA1 (patch-zathura-pdf-mupdf_render.c) = a551478679d14906482673e60bd52cfd6cf74f7a
+SHA1 (patch-zathura-pdf-mupdf_render.c) = 6fb40f5aff3faf7397573f68572aef5922635f37
 SHA1 (patch-zathura-pdf-mupdf_search.c) = 9d21523e2768436fe2e00bc4765d21643d996c0c
 SHA1 (patch-zathura-pdf-mupdf_utils.c) = 92655c0684c72ca42954936f72795d85f4c3a318
diff --git a/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_render.c b/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_render.c
index 1590fdb1b0..a0a982dc50 100644
--- a/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_render.c
+++ b/zathura-pdf-mupdf/patches/patch-zathura-pdf-mupdf_render.c
@@ -1,8 +1,9 @@
 $NetBSD$
 
-Port to mupdf-1.14.0
+- Ignore separations in order to avoid upstream issue #1 and #2
+- Port to mupdf-1.14.0
 
---- zathura-pdf-mupdf/render.c.orig	2018-03-17 19:47:01.000000000 +0000
+--- zathura-pdf-mupdf/render.c.orig	2018-10-04 11:55:20.017813225 +0000
 +++ zathura-pdf-mupdf/render.c
 @@ -18,13 +18,16 @@ pdf_page_render_to_buffer(mupdf_document
      return ZATHURA_ERROR_UNKNOWN;
@@ -24,7 +25,7 @@ Port to mupdf-1.14.0
    } fz_catch (mupdf_document->ctx) {
      return ZATHURA_ERROR_UNKNOWN;
    }
-@@ -32,16 +35,13 @@ pdf_page_render_to_buffer(mupdf_document
+@@ -32,22 +35,18 @@ pdf_page_render_to_buffer(mupdf_document
    fz_close_device(mupdf_page->ctx, device);
    fz_drop_device(mupdf_page->ctx, device);
  
@@ -32,9 +33,10 @@ Port to mupdf-1.14.0
 -  fz_rect rect = { .x1 = page_width, .y1 = page_height };
 -
    fz_colorspace* colorspace = fz_device_bgr(mupdf_document->ctx);
-   fz_separations* seps= fz_page_separations(mupdf_page->ctx, mupdf_page->page);
+-  fz_separations* seps= fz_page_separations(mupdf_page->ctx, mupdf_page->page);
 -  fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, &irect, seps, 1, image);
-+  fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, irect, seps, 1, image);
++  /* TODO: What are separations used for? */
++  fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, irect, NULL, 1, image);
    fz_clear_pixmap_with_value(mupdf_page->ctx, pixmap, 0xFF);
  
 -  device = fz_new_draw_device(mupdf_page->ctx, NULL, pixmap);
@@ -44,3 +46,9 @@ Port to mupdf-1.14.0
    fz_close_device(mupdf_page->ctx, device);
    fz_drop_device(mupdf_page->ctx, device);
  
+   fz_drop_pixmap(mupdf_page->ctx, pixmap);
+   fz_drop_display_list(mupdf_page->ctx, display_list);
+-  fz_drop_separations(mupdf_page->ctx, seps);
+ 
+   return ZATHURA_ERROR_OK;
+ }


Home | Main Index | Thread Index | Old Index