Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encrypted compression "none" vs "store" #22

Open
danielweck opened this issue Jan 16, 2019 · 7 comments
Open

encrypted compression "none" vs "store" #22

danielweck opened this issue Jan 16, 2019 · 7 comments

Comments

@danielweck
Copy link
Member

danielweck commented Jan 16, 2019

https://github.com/readium/webpub-manifest/blob/master/extensions/epub.md#encrypted

The current Readium2 TypeScript / NodeJS implementation uses "none", not "store".
Update: Kotlin, Swift and Go too.

@danielweck
Copy link
Member Author

danielweck commented Jan 16, 2019

Typescript:

https://github.com/readium/r2-shared-js/blob/41eb2bf265d0145ef17a6affd159f2e79ea6d7ed/src/parser/epub.ts#L1488-L1492

if (prop.Compression.Method === "8") {
    encrypted.Compression = "deflate";
} else {
    encrypted.Compression = "none";
}

@danielweck
Copy link
Member Author

Go:

https://github.com/readium/r2-streamer-go/blob/e4bf2ff6f829c2e6a87d62d83e4edf7bb876859c/parser/epub.go#L631-L635

if prop.Compression.Method == "8" {
    encrypted.Compression = "deflate"
} else {
    encrypted.Compression = "none"
}

@danielweck
Copy link
Member Author

@danielweck
Copy link
Member Author

@HadrienGardeur
Copy link
Collaborator

OK, I'm fine using none as well, it just needs to be documented.

How far do we want to go though in the JSON Schema? Should we limit this value to an enum with only deflate and none?

@danielweck
Copy link
Member Author

I think this is safe for now.
http://www.idpf.org/epub/31/spec/epub-ocf.html#sec-enc-compression

Value is either "0" (no compression) or "8" (Deflate algorithm).

@HadrienGardeur
Copy link
Collaborator

It's safe for EPUB but we might need to support other packaging formats in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants