emacs-devel
[Top][All Lists]
Advanced

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

Re: Djvu mode


From: Roland Winkler
Subject: Re: Djvu mode
Date: Fri, 14 Oct 2011 07:52:06 -0500

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 via email to

[Prev in Thread] Current Thread [Next in Thread]