Closed hans-t closed 8 years ago
Hi @hanstzalora, it can be upgraded when phantomjs package for node.js is upgraded. Feel free to submit a pull request when it is ready.
If you want to use phantomjs2
binary, do the following:
phantomjs
binary in <svgexport dir>/node_modules/phantomjs/lib/phantom/bin
with phantomjs2
binary. (I got the phantomjs2
binary by building it from source in Ubuntu 14.04. I believe npm
doesn't have working phantomjs2
yet).render.js
, change these 2 lines:
phantom.args.length !== 1
---> system.args.length !== 2
phantom.args[0]
---> system.args[1]
That's it.
Made a fork with phantomjs2 from https://github.com/Lochlan/phantomjs2
https://github.com/dan335/svgexport
Works on mac and ubuntu 14.04
@dan335 Thanks, but does it works better with phantomjs2?
The phantomjs version that svgexport depends on didn't work for me on mac. It works after switching to phantomjs2. Not sure if it works any better.
@dan335 I see, thanks. I have used svgexport on mac before, if you remember the issue or can reproduce it please report it, I will try to fix it with phantomjs1. I'm interested in using phantomjs2 too, but I'm waiting to make sure it is stable.
Hey, I'm about to open a new issue, but I think it is more related to phantomjs than this module: applying positive saturation to an image filter (lets say 1.6 or 160%) make it fails (no image rendered).
@dan335 , @hanstzalora and anyone who have tried phantomjs2 instead, can you please tell me if phantomjs2 solve the issue?
@shakiba do you think there is something that we can do on svgexport module to fix the issue?
Input example: Output example: SVG: http://23.20.138.218:8082/test/input.svg
Thanks!
saturate: adjusts the saturation of all RGB color channels (the alpha channel is not affected). The permitted value according to the specification is 0-1, but many browsers accept higher values >1 to allow over-saturation. —webplatform.org
@NaxYo It seems that phantomjs-1 (at least) doesn't support over-saturation, I don't know about v2.
If someone face this "positive saturation problem" I have found a workaround by using a colorMatrix instead of saturate. In chrome and phantom it render really similar, I haven't made the full calculation, but I'm pretty sure we can get the same result.
<feColorMatrix type="matrix"
values="1.7 -0.3 -0.3 0 0
-0.3 1.7 -0.3 0 0
-0.3 -0.3 1.7 0 0
0 0 0 1 0">
</feColorMatrix>
Is equivalent to
<feColorMatrix type="saturate" values="2"></feColorMatrix>
Applying cross-multiplication we can get any other value from saturate = 1 -> matrix center = 1, sides = 0; to saturate 2 => matrix center = 1.7, sides = -.3
Hopes it helps someone!
Should be closed now #27 and #28 are closed
@davemackintosh Yes, thanks for your help, and everyone else!
svgexport v0.3.0 now depends on phantomjs-prebuild which uses phantomjs v2.
Hi, is there any plan to upgrade the
phantomjs
used bysvgexport
to version 2?