Skip to content
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

feat: Support all resvg options #12

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

edgarrmondragon
Copy link
Collaborator

No description provided.

pytest.param(
"resources/examples/svg/octocat.svg",
resvg_py.SVGOptions(
shape_rendering=resvg_py.ShapeRendering.GeometricPrecision,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jboarman Do you have handy examples of input/output pairs that might be worth testing here?

There's a bunch of examples in the upstream Rust repo, but it's probably overkill to check all of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we implement the benchmark in issue #10, I think we can make use of a few random selections from the upstream repo that you identified in your comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll try to port a few of the test files to validate the options.

@edgarrmondragon
Copy link
Collaborator Author

edgarrmondragon commented Apr 19, 2023

@jboarman You added this to the readme:

from resvg import Options, render_from_file

options = Options()
options.width = 300
options.height = 200
options.background = "#FFAABB"
options.dpi = 96.0
options.languages = ["en", "fr", "es"]
options.shape_rendering = "optimizeSpeed"
options.text_rendering = "optimizeLegibility"
options.image_rendering = "optimizeQuality"

output_image = render_from_file("input.svg", options)

is that the API you expect, with an end-to-end render_from_file function? In that case, what'd be the output of that function?

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

Successfully merging this pull request may close these issues.

2 participants