Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Alternatives to Batik for scaling images #9

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

Closed
etpinard opened this issue Aug 23, 2017 · 3 comments
Closed

Alternatives to Batik for scaling images #9

etpinard opened this issue Aug 23, 2017 · 3 comments

Comments

@etpinard
Copy link
Contributor

etpinard commented Aug 23, 2017

#6 tries to replace the batik svg to pdf converter with electron's printToPDF. At first glance, things are looking good on that front (ref #6 (comment)),

But, the old image server also uses batik to scale images (from a plotly svg to a scaled png). This gist compares the batik converter with two other node.js libraries (sharp and gm) and a browser-side solution.

The browser-side solution is looking good. It uses context.drawImage's width/height options for png/jpeg/webp formats and viewBox for SVGs.

Can anyone think of possible limitations for the browser-side solution?

@alexcjohnson
Copy link
Collaborator

I can't think of any problems, and if anything I think browser-side should allow us to do better with the crispEdges issues #6 (comment) as it can apply crisp rendering after the image is already scaled up.

@etpinard
Copy link
Contributor Author

etpinard commented Sep 1, 2017

cc plotly/plotly.js#1979

@etpinard
Copy link
Contributor Author

etpinard commented Sep 1, 2017

Closing. This will be done in plotly/plotly.js#1979 and released as part of plotly.js 1.31.0.

@etpinard etpinard closed this as completed Sep 1, 2017
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

No branches or pull requests

2 participants