View Single Post
Old 01-22-2010, 01:56 PM   #24
Peter Sorotokin
speaking for myself
Peter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it is
 
Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
Quote:
Originally Posted by omk3 View Post
So Adobe uses the compressed size instead of the actual size of the files to determine pages.... What can I say...
This is all documented in EPUB Best Practices Guide (http://www.adobe.com/devnet/digitalpublishing/):

When page map is not available in the document, Adobe Digital Editions will synthesize a page-map based on the document content. The approach used is the following:
1. Determine a compressed byte length of each resource which is referenced in the spine, subtracting any known encryption overhead (IV size)
2. Assume that there is a page for each 1024 bytes in each resource, rounding up to the nearest whole number of pages for each resource
3. To map page breaks into a resource, use the number of pages for the resource as determined in step 2, count the number of Unicode characters in the resource; distribute synthetic page breaks in the resource evenly between the characters by dividing the number of characters by the number of pages; if the number of characters don’t divide evenly among the pages, round the number of characters per page up and let the last “page” contain less characters than the rest.

It may be "obvious" to you that uncompressed size should be used, but it would not work reliably. Compressed size is better because it is the only reliable number about the resource without expensive decompression and sometimes decryption (and decryption may not even be possible in some cases).
Peter Sorotokin is offline   Reply With Quote