Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1833047 - dblatex cannot convert png to pdf using inkscape 1.x
Summary: dblatex cannot convert png to pdf using inkscape 1.x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dblatex
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael J Gruber
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-07 17:32 UTC by Damian Wrobel
Modified: 2021-03-19 19:55 UTC (History)
6 users (show)

Fixed In Version: dblatex-0.3.12-2.fc33 dblatex-0.3.12-2.fc32 dblatex-0.3.12-2.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-05 19:16:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Damian Wrobel 2020-05-07 17:32:31 UTC
Description of problem:
dblatex cannot convert images using inkscape as new inkscape changed the format of parameters (e.g. -z is gone) to perform conversion.


Version-Release number of selected component (if applicable):
$ rpm -qv dblatex inkscape
dblatex-0.3.11-4.fc32.noarch
inkscape-1.0-1.fc33.x86_64

I was able to fix the issue by applying the following modifications:

$ diff -u  /usr/lib/python3.8/site-packages/dbtexmf/core/imagedata.py.orig /usr/lib/python3.8/site-packages/dbtexmf/core/imagedata.py
--- /usr/lib/python3.8/site-packages/dbtexmf/core/imagedata.py.orig	2020-01-29 21:48:33.000000000 +0000
+++ /usr/lib/python3.8/site-packages/dbtexmf/core/imagedata.py	2020-05-07 17:15:31.043875032 +0000
@@ -181,7 +181,8 @@
 class SvgConverter(ImageConverter):
     def __init__(self, imgsrc, imgdst="", docformat="", backend=""):
         ImageConverter.__init__(self, imgsrc="svg", imgdst=imgdst)
-        self.add_command(["inkscape", "-z", "-D", "--export-%(dst)s=%(output)s",
+        self.add_command(["inkscape", "-D", "--export-type=%(dst)s",
+                          "--export-filename=%(output)s",
                           "%(input)s"])

Comment 1 Damian Wrobel 2020-05-07 17:41:20 UTC
However, there is another problem that inkspace 1.x is trying to open the GUI dialog[1] (while it shouldn't without --with-gui option) which makes it useless in any batch conversion.

[1] https://gitlab.com/inkscape/inkscape/-/issues/1342

Comment 2 Michael J Gruber 2020-05-07 19:02:03 UTC
Thanks for the report. I've raised this with dblatex upstream to see whether they will follow inkscape or switch to a different svg converter.

Comment 3 Damian Wrobel 2020-06-30 19:07:34 UTC
Do you have any news from upstream?

While I can workaround it locally I had to disable generating documentation e.g. for linuxcnc[1] for >f31 builds due to both: this issue and bug#1833095.

[1] https://copr.fedorainfracloud.org/coprs/dwrobel/linuxcnc/

Comment 4 Michael J Gruber 2020-06-30 19:31:40 UTC
Well, it's really an inkscape bug in the first place (or rather: two), and dblatex upstream are not keen on working around that. They suggest using a different config such as:

<?xml version="1.0" ?>
<!--
  ====================================================================
  Replace inskcape by rsvg-convert to convert SVG graphics
  ====================================================================
-->
<config xmlns="http://dblatex.sourceforge.net/config">
  <imagedata>
    <converter src="svg" dst="*" docformat="pdf">
      <command>
         rsvg-convert -a -f %(dst)s -o %(output)s %(input)s
      </command>
    </converter>
  </imagedata>
</config>

Comment 5 Damian Wrobel 2020-06-30 19:47:27 UTC
(In reply to Michael J Gruber from comment #4)
> Well, it's really an inkscape bug in the first place (or rather: two),

My previous experience with inkscape is also not quite pleasant.
I'm maintaining a package which uses inkscape just to convert icons and starting with inkscape version 1.0[2] and consequently on 1.0.2[3], each time the command line arguments changed in an incompatible way.

So switching in dblatex to use something more stable sounds like a good idea.

[2] https://pkgs.rpmfusion.org/cgit/free/ldoce5viewer.git/commit/?id=7021b57277bc9fad540ffb7ee9721b293aca1149
[3] https://pkgs.rpmfusion.org/cgit/free/ldoce5viewer.git/commit/?id=bb1b94c7faaf6f8f2ca624d0b2ee09d94d8da3af

Comment 6 Ben Cotton 2020-08-11 13:26:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 7 Michael J Gruber 2021-02-18 11:49:20 UTC
Sorry for the late reply.

Upstream suggested to change the default, but a new release which was not announced on the devel list and which renamed the package (so no monitoring triggers) does not include a change (but uses svg directly in the HTML docs rather than converting it).

The new fedora release includes a patch to switch from inkscape to rsvg. Can you test with dblatex 0.3.12 from here:

Rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=62216410
F34: https://koji.fedoraproject.org/koji/taskinfo?taskID=62217189
F33: https://koji.fedoraproject.org/koji/taskinfo?taskID=62217264

Rawhide should show up in the repo soon, the others are scratch builds only so far.

Comment 8 Damian Wrobel 2021-02-24 21:31:43 UTC
It looks that rsvg-convert tool dependency is missing:

rsvg-convert -a -f pdf -o fig0.pdf /home/sw/projects/rpmbuild/BUILD/linuxcnc-03ab5e6adf45b18f975c5717093a85c1abc1d702/docs/src/code/homing.svg
Unexpected error occured
Error: [Errno 2] No such file or directory: 'rsvg-convert'

I saw you have: Recommends:     librsvg2-tools

But that's not enough if the package got successfully updated by using:
$ rpm -U https://kojipkgs.fedoraproject.org//work/tasks/7436/62217436/dblatex-0.3.12-2.fc33.noarch.rpm

Finally, I manually installed the following recommended packages (although I'm not sure if e.g. the ImageMagick is still needed):
$ dnf install -y ImageMagick texlive-epstopdf-bin transfig librsvg2-tools

Overall, the conversion works and the generated documentation looks complete so you might consider to push this update.

Comment 9 Michael J Gruber 2021-02-25 09:35:04 UTC
First of all: Thanks for testing and giving feedback, that's very much appreciated!

As for the recommends: Nothing changed here, the previous inkscape was a weak dependency also. The reason is that dblatex works fine without it. You need a svg->png tool only if you use dblatex in specific circumstances (specific documents and dblatex options). And that's what these weak dependencies are for.

Now, in Fedora land, we're not that good yet at exposing weak dependencies to the user and giving her a choice. But I don't think a packager should decide to pull in every possible weak dependency as a strict requirement (unless not using it is the exotic case).

I think dnf changed its behaviour recently (pulling in weak dependencies it didn't pull in before). For rpm I hope it won't change - it is meant to specifically only install/erase/update a package with the absolutely necessary requirements to have it working. I haven't check but would think that "rpm -i" does not pull in weak dependencies either.

BTW: It's also good to know that we still have users of dblatex. With a basically dead upstream at the time of the py2/py3 switch it was doomed for removal, several (if not all) packages switched away from usig it as their doc processor. The conversion of dblatex to py3 was mostly done by Fedora people. So, it's good to know it was worth it and the package should be kept.

Comment 10 Fedora Update System 2021-02-25 10:03:55 UTC
FEDORA-2021-22912790bc has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-22912790bc

Comment 11 Fedora Update System 2021-02-25 10:04:45 UTC
FEDORA-2021-5a6ed5d7ea has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-5a6ed5d7ea

Comment 12 Fedora Update System 2021-02-25 10:05:23 UTC
FEDORA-2021-b4faa1684d has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-b4faa1684d

Comment 13 Fedora Update System 2021-02-25 23:45:10 UTC
FEDORA-2021-22912790bc has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-22912790bc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-22912790bc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2021-02-26 00:44:48 UTC
FEDORA-2021-5a6ed5d7ea has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-5a6ed5d7ea`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-5a6ed5d7ea

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2021-02-26 01:33:15 UTC
FEDORA-2021-b4faa1684d has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-b4faa1684d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-b4faa1684d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2021-03-05 19:16:07 UTC
FEDORA-2021-5a6ed5d7ea has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2021-03-05 19:23:23 UTC
FEDORA-2021-b4faa1684d has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2021-03-19 17:37:52 UTC
FEDORA-2021-22912790bc has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2021-03-19 19:55:25 UTC
FEDORA-2021-22912790bc has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.