Skip to content

Avoid Inkscape 1.0 deprecation warnings #227

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

Merged
merged 3 commits into from
May 20, 2022
Merged

Conversation

postylem
Copy link
Contributor

@postylem postylem commented May 9, 2022

Update the arguments passed to Inkscape, in order to be in line with current Inkscape argument formats (introduced in Inkscape 1.0, released May 2020).

The current arguments passed to Inkscape result in warnings being printed, if the Inkscape version is 1.0 or later.


Updating these arguments avoids the following deprecation warnings (which are safe to ignore, but annoying):

Warning: Option --without-gui= is deprecated
Warning: Option --file= is deprecated

and

Warning: Option --export-plain-svg= is deprecated

if the format is svg, or

Warning: Option --export-png= is deprecated

if the format is png.

Update the arguments to Inkscape, to be in line with new current Inkscape argument formats (introduced in Inkscape 1.0, released May 2020).

Updating these arguments avoids the following deprecation warnings (which are safe to ignore, but annoying):
```
Warning: Option --without-gui= is deprecated
Warning: Option --file= is deprecated
```
and
```
Warning: Option --export-plain-svg= is deprecated
```
if the format is svg, or
```
Warning: Option --export-png= is deprecated
```
if the format is png.
@postylem
Copy link
Contributor Author

postylem commented May 9, 2022

I just noticed that this has been commented on before in #144, but not implemented in a PR? This is my first PR here, so I hope I'm being helpful.

@postylem
Copy link
Contributor Author

postylem commented May 10, 2022

OK, I saw that the test CI is running with Ubuntu 20.04 on a docker container which has Inkscape v0.92.5 installed. So this doesn't pass the test on that setup since the new argument format is not accepted by the old Inkscape. I missed that before.

I just pushed a fix which checks the Inkscape version and uses the new argument format only if the version is 1.0 or higher.

@postylem postylem requested a review from alerque May 10, 2022 00:38
Copy link
Collaborator

@alerque alerque left a comment

Choose a reason for hiding this comment

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

Good catch, I have v1.0 too but given how slow adoption is making this accessible to v0.9 users makes sense. My suggestion to refactor isn't required if you don't like it, just my suggestion for less code and hence easier to read/understand what is happening.

Okay, I took your suggestions.  I agree it's a little confusing to follow where the '%s' go, but I think you're right this is better than two large blocks of repeated code.
@postylem postylem requested a review from alerque May 10, 2022 12:00
Copy link
Collaborator

@alerque alerque left a comment

Choose a reason for hiding this comment

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

Thanks for the refactor, I think that's quite a bit clearer now.

@tarleb
Copy link
Member

tarleb commented May 20, 2022

Thanks!

We could avoid re-checking the version for every graphic, but the performance impact should be small. It's probably not a big issue.

@tarleb tarleb merged commit aa3fc36 into pandoc:master May 20, 2022
@postylem postylem deleted the patch-1 branch May 20, 2022 11:28
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.

3 participants