Skip to content

Conversation

@seblucas
Copy link
Contributor

@seblucas seblucas commented Dec 9, 2012

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

seblucas and others added 30 commits December 9, 2012 07:34
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.
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).
Copy link
Owner

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?

Copy link
Contributor Author

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

@seblucas
Copy link
Contributor Author

seblucas commented Jul 4, 2016

No problem, Shall I update the PR with the full licence change

@splitbrain
Copy link
Owner

Yes, please update with license corrected.

@mbirth I assume you're fine with MIT as well?

@mbirth
Copy link
Contributor

mbirth commented Jul 4, 2016

@splitbrain Sure, go ahead!

@seblucas
Copy link
Contributor Author

seblucas commented Jul 4, 2016

Done

@splitbrain splitbrain merged commit 7bd2004 into splitbrain:master Jul 6, 2016
@splitbrain
Copy link
Owner

thanks

@mbirth
Copy link
Contributor

mbirth commented Jul 6, 2016

@splitbrain Are you going to list this in Packagist under your id?

@splitbrain
Copy link
Owner

yeah I guess I should

@seblucas
Copy link
Contributor Author

seblucas commented Jul 6, 2016

I don't have any unpushed commit locally and I'll disable my webhook to packagist when you're ready.

@splitbrain
Copy link
Owner

splitbrain commented Jul 6, 2016

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

  • fix the cover handling which you commented out
  • add proper namespacing
  • have proper type hints and doc blocks everywhere
  • have unit tests for all the more complex stuff

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()
Copy link
Owner

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?

Copy link
Contributor Author

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 :(

@seblucas
Copy link
Contributor Author

seblucas commented Jul 7, 2016

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()
Copy link
Owner

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?

Copy link
Contributor Author

@seblucas seblucas Jul 10, 2016

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

4 participants