1. 31 Mar, 2021 7 commits
    • Bastien Nocera's avatar
      lib: Fix memory leak · 323d5025
      Bastien Nocera authored
    • Bastien Nocera's avatar
      lib: Remove absolute external resources from gepub · d843afde
      Bastien Nocera authored
      When setting the internal resources paths to use the custom epub scheme,
      remove all the resources with absolute URIs, they might force us to load
      data from external locations.
    • Bastien Nocera's avatar
      tests: Fix warning when loading file without a cover · a1c4ab99
      Bastien Nocera authored
      This fixes warnings when loading basic-v3plus2.epub.zip.
      CRITICAL **: gepub_doc_get_resource_mime_by_id: assertion 'id != NULL' failed
    • Bastien Nocera's avatar
      widget: Disable a number of "Web" features · 2459dbfc
      Bastien Nocera authored
      Disable Javascript and Java when used in ePubs content.
    • Bastien Nocera's avatar
      widget: Fix ePubs not rendering after the first one · 2b1e373f
      Bastien Nocera authored
      Fix critical error in gnome-books:
      Cannot register URI scheme epub more than once
      Create a new WebKitWebContext for each widget, so we don't run into the
      error above.
    • Bastien Nocera's avatar
      tests: Fix "Invalid read of size 1" · 9d0137b0
      Bastien Nocera authored
      The data might not be NULL-terminated, so don't read past the size:
      ==8841== Invalid read of size 1
      ==8841==    at 0x483BBF4: strlen (vg_replace_strmem.c:461)
      ==8841==    by 0x7F5552D: __vfprintf_internal (in /usr/lib64/libc-2.29.so)
      ==8841==    by 0x7F66BC4: __vasprintf_internal (in /usr/lib64/libc-2.29.so)
      ==8841==    by 0x7E5E5AD: g_vasprintf (gprintf.c:330)
      ==8841==    by 0x7E378FF: g_strdup_vprintf (gstrfuncs.c:514)
      ==8841==    by 0x7E3799B: g_strdup_printf (gstrfuncs.c:540)
      ==8841==    by 0x403651: test_doc_resources (test-gepub.c:257)
      ==8841==    by 0x403651: main (test-gepub.c:452)
      ==8841==  Address 0x1d5931ff is 0 bytes after a block of size 3,247 alloc'd
      ==8841==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
      ==8841==    by 0x7E1E580: g_malloc0 (gmem.c:129)
      ==8841==    by 0x484BDAE: gepub_archive_read_entry (gepub-archive.c:149)
      ==8841==    by 0x484BDAE: gepub_archive_read_entry (gepub-archive.c:132)
      ==8841==    by 0x484C441: gepub_doc_get_resource_by_id (gepub-doc.c:537)
      ==8841==    by 0x403632: test_doc_resources (test-gepub.c:255)
      ==8841==    by 0x403632: main (test-gepub.c:452)
    • Bastien Nocera's avatar
      ci: Add CI · d5340055
      Bastien Nocera authored
  2. 27 Apr, 2019 3 commits
    • IBBoard's avatar
      Stop chapter number updates breaking navigation to anchor links · dbd6d484
      IBBoard authored and Daniel Garcia Moreno's avatar Daniel Garcia Moreno committed
      The reload_current_chapter() function can't check the current URI
      to see whether it has changed and *must* reload the chapter so that
      pagination changes are applied. Instead, we can temporarily remove
      the signal handler to prevent `notify::chapter` triggering a page
      reload that breaks anchor links.
    • IBBoard's avatar
      Update the chapter number when the page changes · a5f2952e
      IBBoard authored and Daniel Garcia Moreno's avatar Daniel Garcia Moreno committed
      This ensures that hyperlinks between pages trigger chapter number
      change signals, which let UIs update their position
      Note: This currently triggers a page reload, which breaks links
      to anchors within pages
    • IBBoard's avatar
      Work with file paths, not URI substrings, in custom URI scheme · 98d613be
      IBBoard authored and Daniel Garcia Moreno's avatar Daniel Garcia Moreno committed
      Using `…_get_uri()` gives a string that includes the anchor, which
      isn't a valid entry path in the archive. `…_get_path()` gets just
      the path (but with a leading slash).
      Rather than special case the widget code to handle the starting slash,
      the archive and doc now ignore the leading slash in paths. This allows
      `…_get_path()` to be used anywhere in the code base without additional
      text manipulation each time.
  3. 21 Apr, 2019 1 commit
  4. 04 Apr, 2019 2 commits
  5. 16 Nov, 2018 1 commit
    • Daniel García Moreno's avatar
      Unscape paths before get from the archive · af28e5b1
      Daniel García Moreno authored
      File paths can be URL encoded because the HTML stuff so we need to
      unescape the string just before try to get from the archive.
      I did that in the gepub-doc and not in the gepub-archive because I think
      that the archive shouldn't know nothing about URL conversion.
      Fix #7
  6. 21 Sep, 2018 2 commits
    • Daniel García Moreno's avatar
      Helper functions to convert from res to chapter · 021364bc
      Daniel García Moreno authored
      The `gepub_doc_resource_uri_to_chapter` and
      `gepub_doc_resource_id_to_chapter` methods are useful to convert a
      resource ID or URI to a chapter number and then use in the
      `gepub_doc_set_chapter` method, to navigate.
      This new helper functions can be combined with the new
      `gepub_doc_get_toc` to navigate in the document.
      See #6
    • Daniel García Moreno's avatar
      Add TOC parse to GepubDoc · 8680a463
      Daniel García Moreno authored
      The new `gepub_doc_get_toc` function returns a GList of GepubNavPoint
      with the `toc.ncx` information. There you can find the epub index.
      I've added a test function to the gepub-test that shows this
      Fix #6
  7. 15 Mar, 2018 2 commits
  8. 24 Feb, 2018 3 commits
  9. 21 Feb, 2018 1 commit
    • Chris Lee's avatar
      Fix the gir generation · 2a0d922f
      Chris Lee authored
      Set the proper C header name for the library, and also save the
      generated gir in a new variable so that it can be accessed to
      more easily generate API bindings.
  10. 17 Jan, 2018 4 commits
    • Bastien Nocera's avatar
      widget: Fix warning at run-time · fc0df782
      Bastien Nocera authored
      There's nothing to reload if we don't have a doc already loaded.
      ** (org.gnome.Books:19113): CRITICAL **: gepub_doc_get_current_with_epub_uris: assertion 'GEPUB_IS_DOC (doc)' failed
       #0  _g_log_abort (breakpoint=breakpoint@entry=1) at /home/hadess/Projects/jhbuild/glib/glib/gmessages.c:583
       #1  0x00007ffff51b6236 in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffff2068) at /home/hadess/Projects/jhbuild/glib/glib/gmessages.c:1391
       #2  0x00007ffff51b6382 in g_log (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff51ffffb "%s: assertion '%s' failed")
           at /home/hadess/Projects/jhbuild/glib/glib/gmessages.c:1432
       #3  0x00007ffff51b6989 in g_return_if_fail_warning (log_domain=log_domain@entry=0x0, pretty_function=pretty_function@entry=0x7fffd1b72740 <__func__.30500> "gepub_doc_get_current_with_epub_uris",
           expression=expression@entry=0x7fffd1b724a1 "GEPUB_IS_DOC (doc)") at /home/hadess/Projects/jhbuild/glib/glib/gmessages.c:2755
       #4  0x00007fffd1b706b0 in gepub_doc_get_current_with_epub_uris (doc=0x0) at libgepub/libgepub/gepub-doc.c:541
       #5  0x00007fffd1b7126f in reload_current_chapter (widget=0x5555562341f0) at libgepub/libgepub/gepub-widget.c:446
    • Daniel García Moreno's avatar
      Updated version number to 0.6 · 3dd04903
      Daniel García Moreno authored
      I've change the base directory and each lib to use the 0.6 in the name
      so we'll be able to have different versions of libgepub installed in the
    • Daniel García Moreno's avatar
      lib: Fix gepub-widget chapter change signal · e2055cfa
      Daniel García Moreno authored
      The GepubDoc property page has been changed to chapter so we need to
      listen to that property change on the GepubWidget to reload the chapter.
    • Daniel García Moreno's avatar
      Merge branch 'wip/rename-pages-to-chapters' into 'master' · 08fb5839
      Daniel García Moreno authored
      This reverts commit 5fc2d0b6.
  11. 16 Jan, 2018 1 commit
  12. 15 Jan, 2018 8 commits
  13. 13 Nov, 2017 5 commits