Comment 6 for bug 340203

Revision history for this message
danh (danh-archive) wrote : right-to-left scandata, handedness

I've modified the scribe code to respond to right-to-left books, under
the assumption that they are scanned starting at the right "back" cover
of the book. Suppose we have a book whose pages and covers
read in left-to-right order:

blank cover 0 1 2 3 cover blank

I'll abbreviate this b c 0 1 2 3 c b.

Then in right-to-left scanning it would appear as:
   c b
   2 3
   0 1
   b c

I've set up the scandata to be written as:
  leaf contents hand rotate
   0 b left 90
   1 c right -90
   2 3 left 90
   3 2 right -90
   4 1 left 90
   5 0 right -90
   6 c left 90
   7 b right -90

Note that in left-to-right books,
right goes with 90 and left with -90,
but this makes the images upside down for
right-to-left books.

Note also that the first two columns must be
as i've written them, but the handedness
column need not be. However, if i choose
the opposite handedness, then the republisher
splits spreads, because, after all, what we
call left should be on the left. That is,
for the example above we'd get 5 spreads
instead of 4, plus some warnings.

Although i have not done it yet, i intend
to also write a flag into the scandata that
this is a right-to-left book (and use the
same notation as what is written in the *_meta.xml).

Note that this works for the 1-up pdf, but the 2-up
pdf gets the pages flipped. That i think i can fix,
although i have not done so yet.

Here's an example book---note that i have not
tried at all to make it nice, i just want to get
the ideas out:

http://www.archive.org/details/zdanh_test_017n_rl

(And note also that there's more coding to do
and checking, per Eric, to make sure we can
insert, etc.)

So: i'd like feedback on the way i did the scandata,
or anything else. In particular, i'd like to know
if this is breaking any other tools.

I haven't checked anything in yet, so the situation
is still pretty fluid. That means that right now
we can take another convention on the handedness
or anything else.

But i do intend to do something about the pdf generation,
so i'd like to know of any problems, especially if
i should do the handedness in the opposite sense.

(I had to change several pieces of code because, naturally,
there were strong underlying assumptions about how leaf
numbers map to sides and angles.)