-
Notifications
You must be signed in to change notification settings - Fork 18
Allow downloading an updated epub without saving it in a temporary directory #9
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
Conversation
having to create one in a temporary directory
to work with kepub.epub Warning : the epub won't be valid anymore.
Fix updating zip without signature in header
--HG-- rename : test/test.phpunit.php => test/epubTest.php
This will fix the downloaded filename with Edge, IE11 if it contains a non ASCII character.
for backwards compatibility. (hopefully)
Composer Packagist support
LICENSE
Outdated
| SOFTWARE. | ||
|
|
||
| All code created or modified by Sébastien Lucas <[email protected]> is licensed | ||
| under GPL 2 (http://www.gnu.org/licenses/gpl.html). |
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.
I don't want to merge this with the license change. I like to keep this library MIT compatible. Can you agree to license your code under MIT?
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.
No problem, Shall I update the PR with the full licence change
|
No problem, Shall I update the PR with the full licence change |
|
Yes, please update with license corrected. @mbirth I assume you're fine with MIT as well? |
|
@splitbrain Sure, go ahead! |
|
Done |
|
thanks |
|
@splitbrain Are you going to list this in Packagist under your id? |
|
yeah I guess I should |
|
I don't have any unpushed commit locally and I'll disable my webhook to packagist when you're ready. |
|
I just reverted my master back to the old status and merged your changes into a devel branch (sorry for the force push). I also started to clean up the whole thing a bit. I'd like to bring the status of this library to a better state before publishing it on packagist. In particular there are these things I'd like to have done first
Any help welcome. BTW. while I went through the code I noticed a few things that were unclear to me - I'll add inline code questions here... |
| /** | ||
| * Get the components list as an array | ||
| */ | ||
| public function components() |
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.
I'm unfamiliar with "components" - I'm not quite sure what they are. Can you quickly explain what they are and also why they need that weird encoding/decoding further down?
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.
All the example I'll use come from fb.opf that is inside test/test.epub.
First the term component is not a good one, it should be SpineItem or something like that. The method return the book's TOC (called spine in line 202 of fb.opf). Instead of simply returning ids (idref) if return the full pathname by using the manifest (line 26 of fb.opf).
The weird encoding/decoding come from the bad decision before. Instead of using the spine Id, I now have a path that I'll use in a query param (in COPS) -> so I had to encode / decode it.
Using proper idref has been on my Todo list since 2014 :(
|
I answered your questions, I won't have much time in the summer. But I'll at least try to answer each of your questions. To tell you more about the context of my latest modifications, I wanted to use Monocle as an Epub Reader and I needed a clean way to access the inside of an Epub file (XHTML, CSS, images, ...). The glue code between this project and Monocle is https://github.com/seblucas/cops/blob/master/epubfs.php |
| return $path; | ||
| } | ||
|
|
||
| public function updateForKepub() |
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.
@seblucas can you explain what this function is needed for?
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.
Kobo don't use the standard EPUB for their own books coming from their store.
Instead they use their own format Kepub (You can have more information here). Simply renaming test.epub to test.epub.kepub before sideloading it to a Kobo eReader will make it more or less handled as a Kepub.
In this function I only added a mandatory key allowing the cover to be correctly detected by Kobo eReader. I initially wanted to alter the HTML to add all the span but Kobo changed the way they handled sideloaded Kepub.
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.
In fact it is a standard property for EPUB 3 : http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-item-property-values
Hi,
I really don't know if you'll be interested but I need that for a project (https://github.com/seblucas/cops). I'll add epub.php in it next week or so.
Thanks a lot for your work in this project (and dokuwiki too ;)).
Sébastien