Giter Site home page Giter Site logo

Comments (8)

Grandt avatar Grandt commented on August 15, 2024

At the point where this happens in EPub, I'm already parsing the HTML
DOM, so I'll make the change there.

Thanks for a good idea though :).

I'll be updating GitHub shortly. The addChapter function have a
parameter for external references. Previously
EPub::EXTERNAL_REF_REPLACE_IMAGES would cause addChapter to replace all
images with "[image]", I've changed that if it's present, it'll
use the alt tag value instead of "image", else it'll fall back to just
"image"

Which version do you use? The regular EPub.php or the new EPub250.php?

Cheers
A.Grandt

On 04-10-2013 21:31, Adrien Dorsaz wrote:

Hello!

I think, it could be good to display the alt value of images instead
of simply removing entire tag.

It can be done with this regexp for example:

$html_content = preg_replace('/<\s_?img.alt="(.?)"._?>/', '${1}', $html_content);

I'll use this regular expression in my epub plugin for the Leed RSS
reader and I think, it can be usefull for you too.

Thanks for your great work on PHPePub !


Reply to this email directly or view it on GitHub
#12.

from phpepub.

Trim avatar Trim commented on August 15, 2024

I'm using Epub250.php simply because I've tried it first and it worked well for my needs (and because I like the modularity).

Indeed, I've used EPub::EXTERNAL_REF_IGNORE because I thought that it was not only about images, but really all external references (like video, audio, ..., but I don't know what a epub can contain).

I think, I'll use the REPLACE_IMAGES so. Thanks !

from phpepub.

Grandt avatar Grandt commented on August 15, 2024

You are right, EXTERNAL_REF_IGNORE removes all externals. And it will
erase images entirely.
I'll have to think about that one for a short while. Should ignore place
the image alt value or not...

I'm currently playing with how to best support nested chapters (chapter
levels). The EPub.NCX alreasy suppirts it, but I'm still trying to
figure out how to expose this in the EPub.

Cheers.

On 05-10-2013 11:51, Adrien Dorsaz wrote:

I'm using Epub250.php simply because I've tried it first and it worked
well for my needs (and because I like the modularity).

Indeed, I've used EPub::EXTERNAL_REF_IGNORE because I thought that it
was not only about images, but really all external references (like
video, audio, ..., but I don't know what a epub can contain).

I think, I'll use the REPLACE_IMAGES so. Thanks !


Reply to this email directly or view it on GitHub
#12 (comment).

from phpepub.

leikxile avatar leikxile commented on August 15, 2024

Hi i'm currently using the Epub.php and i've noticed that when downloading external animated gif images. The images that has been downloaded loses its animation.

from phpepub.

Grandt avatar Grandt commented on August 15, 2024

leikxile, even with the latest version updated 2 days ago. I added Gif's as a valid format (older readers using the Adobe Digital Editions, can crash on Gifs.)
You need to set $book->isGifImagesEnabled = TRUE;
If not, can I get you to send me an example book having this gif to [email protected] ?

from phpepub.

leikxile avatar leikxile commented on August 15, 2024

Sent

from phpepub.

leikxile avatar leikxile commented on August 15, 2024

Updated to the latest version and everything seems to be working now. Thank you!

from phpepub.

Grandt avatar Grandt commented on August 15, 2024

Resolved, closing.

from phpepub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.