unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: Camm Maguire <camm@maguirefamily.org>
Cc: joakim@verona.se, emacs-devel@gnu.org
Subject: Re: Djvu mode
Date: Fri, 14 Oct 2011 07:52:06 -0500	[thread overview]
Message-ID: <20120.12406.217640.108007@gargle.gargle.HOWL> (raw)
In-Reply-To: <87ipnuqlsx.fsf@maguirefamily.org>

On Wed Oct 12 2011 Camm Maguire wrote:
> Greetings!  Where do we stand on this project?

Correct me if I am wrong:

- Joakim's name found its way into this thread because he was
  interested in a direct support for rendering djvu files inside
  emacs. So he was a driving force for adding ImageMagick to Emacs
  24. In principle, ImageMagick can render djvu files. Yet the
  implementation does not yet work perfectly smooth, in particular
  for multipage djvu documents, where apparently ImageMagick
  attempts to put all pages into memory before it displays the first
  page.

- Camm, I am sorry, I have not yet fully understood your code which
  unfortunately doesn't have very many comments, and many variables
  names are just one-letter names which doesn't make it easier for
  me, either.

  Anyway, it appears to me that the internals of your code rely on
  djvu images being converted to ppm format so that this code can do
  a fair amount of bit shifting in order to incorporate any
  highlighting in a djvu page into the image that is displayed by
  emacs.

  In the end, this highlighting is a cool feature, which, to the
  best of my knowledge, could not be implemented by other means
  currently available within emacs.

- Finally, my code has not yet worried much about any internal
  display engine for djvu images. A major reason for this is that
  most of this code's functionality is not tied to any viewer, but
  it is is mostly operating on the text and annotation layers of
  djvu files. Then it uses the djview viewer from djvulibre which I
  find extremely fast for djvu files even if this viewer needs to be
  restarted frequently. (For this, it also helps that upon startup,
  djview can jump to the right place in the document.)

  In the meanwhile, I've also added some basic support to this code
  to display the djvu images inside emacs. So one can mark a region
  in these images that gets highlighted in the djvu file, kind of
  similar to what your code has been doing.

- Another basic difference in the design of the two djvu modes is
  the handling of the text layer. Your code extracts the complete
  text layer of multipage documents so that it becomes searchable
  from within emacs. In principle, this is a great feature. Yet I
  find it too slow if a djvu document has many pages (a major
  bottleneck being the extraction of the complete text layer upon
  startup which makes loading a larger djvu document rather slow).

  So my code works strictly on one page at a time. With this
  approach, loading large documents does not take more time than
  loading small ones. The price to pay is that the document is not
  searchable beyond the current page. Personally, I do not find that
  a big problem because djview can search djvu documents extremely
  fast.

  It might be possible to aim for the best of both worlds by
  defining a limit for the total page number of a document up to
  which the whole text layer is extracted. Beyond this limit, one
  would operate on one page at a time. I have not yet thought about
  how this can possibly be implemented.

So there are some basic differences in the design of the two modes
that make it more difficult to go for something like a simple merge.

I do not know what your thoughts have been to set up the features in
your code the way they are.

Roland



  reply	other threads:[~2011-10-14 12:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 20:17 highlighting large regions (comments) with font-lock keywords Eric Schulte
2011-09-28  1:30 ` Stefan Monnier
2011-09-28 13:08   ` Eric Schulte
2011-09-28 14:18 ` Djvu mode Camm Maguire
2011-09-28 16:50   ` Sivaram Neelakantan
2011-09-29 16:07     ` gnu-emacs-sources down? [was: Djvu mode] Roland Winkler
2011-09-29 16:21       ` gnu-emacs-sources down? Glenn Morris
2011-09-29 17:39       ` gnu-emacs-sources down? [was: Djvu mode] Sivaram Neelakantan
     [not found]       ` <87r52zl29j.fsf_-_@maguirefamily.org>
     [not found]         ` <20100.46983.768447.889306@gargle.gargle.HOWL>
     [not found]           ` <87d3ejgmmz.fsf@maguirefamily.org>
     [not found]             ` <20103.17789.10053.53615@gargle.gargle.HOWL>
2011-10-02  4:22               ` Djvu mode Camm Maguire
2011-10-03 18:23                 ` Roland Winkler
2011-10-03 19:41                   ` Camm Maguire
2011-10-03 19:59                   ` Camm Maguire
2011-10-03 20:35                   ` Camm Maguire
2011-10-04  6:20                     ` Roland Winkler
2011-10-12 15:19                       ` Camm Maguire
2011-10-14 12:52                         ` Roland Winkler [this message]
2011-10-04 10:21                     ` Roland Winkler
2011-09-28 21:02   ` Stefan Monnier
2011-09-29  6:26   ` Roland Winkler
2011-09-29  9:08     ` joakim
2011-09-29 19:07       ` Roland Winkler
2011-09-29 20:06         ` Camm Maguire
2011-09-29 21:34         ` joakim
2011-10-01 17:01           ` Roland Winkler
2011-10-01 17:19             ` joakim
2011-10-01 18:04               ` Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120.12406.217640.108007@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=camm@maguirefamily.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).