unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Camm Maguire <camm@maguirefamily.org>
To: "Roland Winkler" <winkler@gnu.org>
Cc: joakim@verona.se, emacs-devel@gnu.org
Subject: Re: Djvu mode
Date: Mon, 03 Oct 2011 15:41:40 -0400	[thread overview]
Message-ID: <87botxq2vf.fsf@maguirefamily.org> (raw)
In-Reply-To: <20105.64927.931187.909507@gargle.gargle.HOWL> (Roland Winkler's message of "Mon\, 3 Oct 2011 13\:23\:27 -0500")

[-- Attachment #1: Type: text/plain, Size: 4524 bytes --]

Greetings!

"Roland Winkler" <winkler@gnu.org> writes:

> On Sun Oct 2 2011 Camm Maguire wrote:
>> Currently the code ignores but preserves non-djvm-mode produced
>> annotations, but this should be easy to add.  
>
> I am sorry, I am confused! What kind of annotations are then added
> to the file? Are they incompatible with the standard djvu format?
> Why that?
>

The code reads all annotations, creates some, edits some that it has
created, and writes the whole lot back to the file.  It does not
display or edit "foreign" annotations yet.

The newly constructed annotations should be completely compatible.
There is a comment field in the maparea list.  I use this to label the
areas created by the djvm code primarily just as an initial rough
implementation to separate my stuff from whatever else may be in a
file.  But secondarily, the comment is used to group highlighted
regions into one block in the case they consist of contiguous
rectangles, such as highlights anchored on word boundaries, or text
comment boxes in the margin of, and logically "attached" to,
highlighted text.  The maparea construct has no other field for such
grouping AFAICT.

There is no permanent reason that this code cannot edit and display
foreign annotations.  Each maparea would have to be logically
distinct, but that is OK.  And there are several other maparea
features which are as yet unimplemented.

>> Me too.  This is the main point.  I am currently using it for this
>> with success.  I'm not really sure though whether text notes are best
>> placed in the file, as you have to click on the box to see them (in
>> emacs djvm mode or djview), 
>
> Depending on how you set up the annotations. djview displays them
> immediately - at least for me (with DjVuLibre DjView 4.5 under GNU linux).
>

OK.  Still much harder to read then what I'm really used to, which is
my own handwriting in the margin.  Alas, those days appear gone and we
must adapt as best we can.

Another weakness/feature of the current implementation is that no
margin text is written on the image over a comment box.  In emacs, one
does have to click on the box to get at the text in another buffer.
Don't know how severe this is.

>> > nicely displays these annotations including any text layers they
>> > might have.
>> 
>> Emacs with this mode does too, but just for the annotations it writes
>> itself at the moment.  It labels these with a "djvm" comment.
>
> Why "djvm"? Why being incompatible?
>

Is a comment incompatible?  The mapareas written by the djvm code show
up correctly under djview in my experience.  They display the comment
tag in djview when the mouse moves over the highlight, but this does
not appear incompatible to me.  Am I missing something?  Full
compatibility with all standards is the goal, to say the least.

>> This is a somewhat common indication of a poorly constructed text
>> layer by an early ocr engine.  I've always cleared this by a fresh
>> ocrodjvu --in-place foo.djvu.  Boxes then line up perfectly.  I think
>> the ocr code has only very recently matured.
>
> Again I am confused. Take the djvu file I attached earlier in this
> thread (produced with pdf2djvu-0.7.7). If I search a word via
> djview, it highlights the matches such that the boxes are perfectly
> aligned with the text. So I assume that the djvu file is OK. Yet
> with your mode the highlighting is shifted relative to what it is
> supposed to match. Something is misaligned here. 
> (My emacs is GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+
> Version 2.20.1) of 2011-09-19.)
>
> What am I missing here?

Thanks for this pointer, you are missing nothing.  The current code is
assuming a page box beginning at 0 0 as this is what I've been
accustomed to working with ocrodjvu.  Told you it was rough!  I see
now this is really a special case, and will post a patch soon.

If you want to see correct alignment for further testing/commenting
purposes, take a look at p2.djvu below, which I've ocr'ed as described
earlier.  You can also see the different layout in the text layer.

BTW, there are a few other needed improvements of which I'm currently
aware.  For example, I've written the routines mostly recursively from
my experience with GCL, but this is blowing out emacs limits on some
really big files.

Take care,

>
> Roland
>
>
>
>

-- 
Camm Maguire			     		    camm@maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

[-- Attachment #2: p2 --]
[-- Type: image/vnd.djvu, Size: 14554 bytes --]

  reply	other threads:[~2011-10-03 19:41 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 [this message]
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
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=87botxq2vf.fsf@maguirefamily.org \
    --to=camm@maguirefamily.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    --cc=winkler@gnu.org \
    /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).