-
Notifications
You must be signed in to change notification settings - Fork 163
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
Conflict resolved full request for update Radium SDK to support LCP implementation #219
Changes from all commits
d8331bb
496f10a
1515a21
d3e8d7d
63b3f8f
43e2ed6
d33eb8c
5e06ed5
4069d0e
12bec95
c8b45ea
045df1b
873697c
5b2395b
1a345f4
c837757
b49f7ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,14 +23,21 @@ | |
|
||
EPUB3_BEGIN_NAMESPACE | ||
|
||
// Added by T.H. Kim on 2015-04-15 | ||
#define ReadiumURI "http://readium.org/2015/01/lcp#extendedProperty" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be consistent with the LCP server! See: readium/readium-lcp-server#24 |
||
bool EncryptionInfo::ParseXML(shared_ptr<xml::Node> node) | ||
{ | ||
// Modified by T.H. Kim on 2015-04-15 | ||
// To add ReadiumURI namespace to process the addition information | ||
|
||
#if EPUB_COMPILER_SUPPORTS(CXX_INITIALIZER_LISTS) | ||
XPathWrangler xpath(node->Document(), {{"enc", XMLENCNamespaceURI}, {"dsig", XMLDSigNamespaceURI}}); | ||
XPathWrangler xpath(node->Document(), {{"enc", XMLENCNamespaceURI}, {"dsig", XMLDSigNamespaceURI} , { "ep", ReadiumURI }}); | ||
#else | ||
XPathWrangler::NamespaceList nsList; | ||
nsList["enc"] = XMLENCNamespaceURI; | ||
nsList["dsig"] = XMLDSigNamespaceURI; | ||
nsList["ep"] = ReadiumURI; | ||
XPathWrangler xpath(node->doc, nsList); | ||
#endif | ||
|
||
|
@@ -45,6 +52,32 @@ bool EncryptionInfo::ParseXML(shared_ptr<xml::Node> node) | |
return false; | ||
|
||
_path = strings[0]; | ||
|
||
// Added by DRM inside, T.H. Kim on 2015-04-15 | ||
// To get additional information for the compressed and encrypted contents | ||
strings = xpath.Strings("./enc:EncryptionProperties/enc:EncryptionProperty/ep:compression/@method", node); | ||
if (!strings.empty()) | ||
{ | ||
if (strings[0] == "0" || strings[0] == "8") | ||
_compression_method = strings[0]; | ||
else | ||
return false; | ||
|
||
} | ||
else if (strings.empty()) | ||
_compression_method = "0"; | ||
|
||
strings = xpath.Strings("./enc:EncryptionProperties/enc:EncryptionProperty/ep:compression/@sourceSize", node); | ||
if (!strings.empty()) | ||
{ | ||
for ( int i = 0 ; i < strings[0].size() ; i++) | ||
if (strings[0][i] < '0' || strings[0][i] > '9' ) | ||
return false; | ||
|
||
_uncompressed_size = strings[0]; | ||
} | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
return true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following discussion, we might want to consider There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow-up - see IDPF EPUB3 issue: w3c/epub-specs#646 |
||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nleme the code above has been merged to develop, so I wonder if this issue and associated PR is still valid?
#177
https://github.com/readium/readium-sdk/pull/179/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And just a reminder of the pending zip lib update PR (not sure how this zip_fseek patch will survive / need to be adjusted):
#191 (comment)