Grandt / PHPePub

PHP Classes for dynamically generating EPub files.
http://www.phpclasses.org/package/6115
241 stars 83 forks source link

Corrupted epub when opening it with Adobe Digital Editions #9

Closed slopdo closed 11 years ago

slopdo commented 11 years ago

Hello,

I can create an epub and it's opening without any problem in Calibre and also in a Sony Reader. However, if I try to open it with Adobe Digital Editions it says that the file is corrupted.

Is there anything I should take into account to solve the issue?

Thank you!

Grandt commented 11 years ago

Is it all your books? Does Adobe DE provide any information? Can I get you to create a simple test book that displays this behaviour in ADE, and send it to php@grandt.com?

Grandt commented 11 years ago

I forgot to ask which version of ADE you are using. I just tried it with the latest as well as an old one where I couldn't find the version number. The book I tried was the output from EPub.Example1.php and I had no errors. I'd still like a test book displaying this, just in case.

slopdo commented 11 years ago

Thank you for answering. I've sent you an email with the epub attached.

Grandt commented 11 years ago

The mail had no attachment.

Grandt commented 11 years ago

Got it. and got the problem. Now I 'just' have to fix it.

In short, wordpress images have extra attributes attached to their file names, in the case of the images, it is width and height ( for instance "....jpg?w=400&h=200"). As it turns out, the characters '?', '&' and '=' are a bad idea in file names on an ePub. I just have to filter those, but in a way that preserves the uniqueness of the file name.

Thanks for finding the problem.

slopdo commented 11 years ago

Thank you for all you help!

Grandt commented 11 years ago

Been a bit away, can I close this ?

slopdo commented 11 years ago

Sure!