-
Notifications
You must be signed in to change notification settings - Fork 84
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
Error converting markup with svgs #34
Comments
Please have a look at 4.0.5-beta1 |
You're so fast! Thanks a lot for your efforts! I'll have a look this evening. |
Seems to work beautifully. Thank you so much! |
Can I get you to test one more thing while you are at it? |
Hmmm, that doesn't seem to work. Tried adding a 4000x4000 pixels svg file. The svg file included within the Original svg: <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 4000 4000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Ebene1"><rect x="411.445" y="269.874" width="1021.12" height="1153.57" style="fill:#50df50;"/><ellipse cx="3061.76" cy="1551.06" rx="619.986" ry="1117.49" style="fill:#d2e7e7;"/><path d="M2938.12,1540.04c0,-284.276 -230.796,-515.071 -515.071,-515.071l-1030.14,0c-284.275,0 -515.071,230.795 -515.071,515.071l0,1106.84c0,284.276 230.796,515.071 515.071,515.071l1030.14,0c284.275,0 515.071,-230.795 515.071,-515.071l0,-1106.84Z" style="fill:#ec5656;"/></g></svg> Svg in epub file: <?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 4000 4000" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Ebene1"><rect x="411.445" y="269.874" width="1021.12" height="1153.57" style="fill:#50df50;"/><ellipse cx="3061.76" cy="1551.06" rx="619.986" ry="1117.49" style="fill:#d2e7e7;"/><path d="M2938.12,1540.04c0,-284.276 -230.796,-515.071 -515.071,-515.071l-1030.14,0c-284.275,0 -515.071,230.795 -515.071,515.071l0,1106.84c0,284.276 230.796,515.071 515.071,515.071l1030.14,0c284.275,0 515.071,-230.795 515.071,-515.071l0,-1106.84Z" style="fill:#ec5656;"/></g></svg> |
I think I'll change that and leave the SVG's be. Setting their size changes nothing anyway, unlike the bitmap formats where that'll reduce the size of the files as well. |
Seems like your latest commit broke things. I guess this line (57f3c11#diff-738d6dc186ddd5f8e5366f4bef5652b0R634) shouldn't be commented out, right? |
Agreed, the width and height aren't being set. I'm looking at extracting the SVG metadata now.. |
Nah, I meant the |
I don't think extracting SVG meta data is necessary. It works fine, even with huge SVGs, right now. |
The reason I commented that $image line out was that it should have been irrelevant. $image was already set. I have committed another one, as I had practically already finished the rescale part. All I'm doing now is reading the hight/width from the viewbox, and place the rescaled size in the width/height attributes. |
Seems to work fine with your latest commit. All SVGs get the correct width/height attributes applied and the ePub displays fine for me. |
Thank you for helping me test this. :) |
Thank you for maintaining this lib so actively! |
Feel free to let me know if you have any other issues. |
Generally, creating an epub from my html markup works just fine and this library is a HUGE time saver. Thank you so much for creating and maintaining it!
There is only problem I'm facing right now though: Whenever my original HTML markup contains an
<img>
tag linking to a SVG file, adding it to a chapter fails (withEPub::EXTERNAL_REF_ADD
enabled, to embed all image files into the epub file). Adding any other image format like PNGs and JPEGs works as expected and if I disableEPub::EXTERNAL_REF_ADD
it works, too. I also tried adding other SVG files which still results in the error.Here's the exact error message I'm facing:
This is the markup related to the SVG I'm trying to convert:
Using the latest release with composer.
The text was updated successfully, but these errors were encountered: