⚠️ ᴛʜɪs ʀᴇᴘᴏsɪᴛᴏʀʏ ɪs ᴅᴇᴘʀᴇᴄᴀᴛᴇᴅ⚠️ We moved all the
r2-*-swift
modules to a single repository:swift-toolkit
.
readium / r2-streamer-swift Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
⚠️ ᴛʜɪs ʀᴇᴘᴏsɪᴛᴏʀʏ ɪs ᴅᴇᴘʀᴇᴄᴀᴛᴇᴅ⚠️ We moved all the
r2-*-swift
modules to a single repository:swift-toolkit
.
The streamer should parse Media Overlay SMIL files referenced in the Package Document manifest.
Parsed information shoud be stored in a tree-like structure that can be serialized to JSON.
For readability and maintainability.
Publication.tableOfContents is empty when importing publication.
Using the develop branch.
When I create a new project and I add the r2-streamer-swift pod, I can't build the project. There are a lot of missing types: MediaType, Encryption, EPUBLayout, essentially a bunch of stuff from R2Shared - however I see no issues building R2 shared, and r2shared does seem to be listed as a framework of R2Streamer.
I tried some naive poking around to see if I could fix it (changing swift version from 5 -> 4.2, adding CoreMedia as a framework) but nada.
(devenv: Xcode 14, was defaulted to Swift 5, but tried 4.2 as well, using head of 'develop' branch)
In the Go version of the streamer, some properties are converted this way (see the contains nested array) :
{
"href": "xhtml/svg-007.xhtml",
"type": "application/xhtml+xml",
"properties": {
"contains": [
"svg"
]
}
}
In the swift streamer the Link's properties are stored in a simple String
array.
The mapping library ObjectMapper
is too strongly coupled with the model.
We only need Marshaling, but with objectmapper we implement Unmarshalling functions, then the it create the Marshaling methods by reflection.
Detailed explanations here.
the url provided in Readme.md pointing to your documentation does not seem to work anymore
after installing the module using pod install building the app from xcode fails with the following error
`
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
could not deserialize extension: top-level value not found
Cross-reference to module 'R2Streamer'
... GCDWebServerResponse
environment
Xcode 11.2.1
Catalina 10.15.1
branch develop
Any hint ?
For readability and maintainability.
As a follow-up to #36 we're moving away from using paths relative to the OPF in the streamer.
We'll now stictly use absolute paths based on the root of the container instead.
The following resource types that we parsed are affected:
OPF
Navigation Document
NCX
SMIL
While encryption.xml parsing is not as directly affected by this change, we need to make sure that we still match resources correctly after this change.
In the streamer, we should now have absolute URIs in the following elements:
spine
resources
all ToC collections (toc, landmarks, loi, page-list, ...)
media overlay APIs
The parser and the Publication model object should support multilingual properties for:
This is done in order to be able to call them in initializers
before the call of super.init()
.
There must be a better way to solve this.
The parser should parse the following metadata:
When you import r2streamer you need to go into
EPUBParser row 199 and and add a ! here: data: smilDataOptional!
Same with PDFParser on row 195: data: optionalData!
It would be good not to have to do this everytime you do pod update/install
While implementing the font deobfuscation I found that the WKWebView caching was enabled by default. After disabling it for testing purpose I started to encounter problems when fetching resources from ZipInputStream.
This bug is also existing in the previous versions of the project if you add this piece of code to the launcher in the SpineItemViewController
:
if #available(iOS 9.0, *)
{
let websiteDataTypes = NSSet(array: [WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache])
let date = NSDate(timeIntervalSince1970: 0)
WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes as! Set<String>, modifiedSince: date as Date, completionHandler:{ })
}
else
{
var libraryPath = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.libraryDirectory, FileManager.SearchPathDomainMask.userDomainMask, false).first!
libraryPath += "/Cookies"
do {
try FileManager.default.removeItem(atPath: libraryPath)
} catch {
print("error")
}
URLCache.shared.removeAllCachedResponses()
}
As seen in readium/swift-toolkit#96, the Kotlin and Swift parsers are not producing strictly the same Publication
objects. We should check the parsers to make sure they produce identical Publication
across platforms.
A very helpful thing to have would be a shared Git repository of test cases: book files + associated JSON RWPM, to validate automatically the parsers.
This should not be long to implement and it will clear the way for future format additions.
For readability and maintainability.
A tap event is always sent from the javascript even if the touch event is long.
Steps to reproduce:
There should instead be a check wether the touch was "short enough" for it to be recognised as a tap.
Unfortunately I do not know what the default value of a single tap in iOS is, but around 0.5 seconds could probably be a value to aim for.
Ps. This needs to be implemented in a more sophisticated way if support for double tap was to be implemented. Ds.
The parser should parse the <subject>
elements of the metadata and add them to the Publication's metadata properties.
If not done before, will be fixed by fixing issue #13
From :
"links" : [
{
"href" : "images\/cover.jpg",
"properties" : [
],
"type" : "image\/jpeg",
"rel" : [
"cover"
]
},
//...
]
To :
"links" : [
{
"href" : "images\/cover.jpg",
"type" : "image\/jpeg",
"rel" : [
"cover"
]
},
//...
]
The project does not compile on a case-sensitive file system, because a few directory references in the project file are specified with capital letters while the actual directory on the file system are named with lower letters.
I've created a PR for this.
See details here:
readium/webpub-manifest#24
Add methods for serializing the mediaOverlays property (MediaOverlays
) in a json element.
The parser should parse the file encryption.xml
and store encoding information in the Link
object.
As it's been pointed out in the EPUB 3 maintenance group, EPUB 3.1 doesn't allow content producers to indicate more than a single role for a contributor.
In EPUB 3.0.x it was possible to indicate as many roles as you wanted:
<dc:contributor id="Olaf">Dr. Olaf Hoffmann</dc:contributor>
<meta refines="#Olaf" property="file-as">Dr. Hoffmann, Olaf</meta>
<meta refines="#Olaf" property="role" scheme="marc:relators">mrk</meta>
<meta refines="#Olaf" property="role" scheme="marc:relators">art</meta>
<meta refines="#Olaf" property="role" scheme="marc:relators">ill</meta>
<meta refines="#Olaf" property="role" scheme="marc:relators">aui</meta>
<meta refines="#Olaf" property="role" scheme="marc:relators">pfr</meta>
The Readium Web Publication Manifest is a direct descendent of the BFF project and was designed with 3.1 round-trippability in mind.
But in the context of Readium-2, we want to maximize compatibility with EPUB 2.0.1 and any 3.x revision, which means that instead of having a single string allowed for the role in a contributor element, we need to move to an array of string.
This happens with this epub Tanka_RyokufuSanka
Add following native properties (as opposed to and instead of entries in the properties
property of Link) to Link model for page, spread, layout, orientation et overflow à la classe Link, qui remplace les propriétés rendition:*
et page-spread-*
I want add a custom font,
Please give me a guide on how to do this.
When I add test suite books to R2 Reader test app, for example EPUB Test Suite 150, table of contents is not parsed by the streamer.
For readability and maintainability.
Extract MetadataParser
, NavigationDocumentParser
, NCXParser
from OPFParser
for clarity.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.