1

I have installed inkscape on Ubuntu 20.04.

The version of inkscape is

inkscape -V

Gtk-Message: 20:38:33.029: Failed to load module "canberra-gtk-module" Gtk-Message: 20:38:33.030: Failed to load module "canberra-gtk-module" Inkscape 1.3.2 (9e3d6414e7, 2024-01-14, custom)

I want to convert an svg file into png. The problem is when I give a relative path to inkscape, instead of interpreting the path as relative, it is interpreted as relative to the home folder:

inkscape ./mydrawing.svg --export-area-drawing --batch-process --export-type=pdf

gives

Gtk-Message: 20:42:58.054: Failed to load module "canberra-gtk-module"
Gtk-Message: 20:42:58.056: Failed to load module "canberra-gtk-module"

** (org.inkscape.Inkscape:175089): WARNING **: 20:42:58.388: Can't open file: /home/myhome/mydrawing.svg (doesn't exist)

** (org.inkscape.Inkscape:175089): WARNING **: 20:42:58.388: Can't open file: /home/myhome/mydrawing.svg (doesn't exist) ink_file_open: '/home/myhome/mydrawing.svg' cannot be opened! InkscapeApplication::document_open: Failed to open: /home/myhome/mydrawing.svg ConcreteInkscapeApplication::on_open: failed to create document!

hence, it cannot open the file.

Regarding to the error:

Failed to load module "canberra-gtk-module"

I tried these solution

sudo apt-get install libcanberra-gtk-module:i386
sudo apt install -s --reinstall libcanberra-gtk-module
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module

as well as all solutions provided at this question and none of them worked. I am not sure if this warning is causing this problem.


type -a inkscape ; ls -l /etc/apt/sources.list.d
inkscape is /snap/bin/inkscape
total 0

Version 1.3.1 is a stable version:

snap list inkscape  --all
Name      Version                           Rev    Tracking       Publisher  Notes
inkscape  1.3.2-9e3d6414e7-2024-01-14-cust  10563  latest/stable  inkscape✓  disabled
inkscape  1.3.1-9b9bdc1480-2023-11-25-cust  10555  latest/stable  inkscape✓  -

I also tried:

snap refresh --stable inkscape
inkscape 1.3.1-9b9bdc1480-2023-11-25-cust from Inkscape Project (inkscape✓) refreshed

muru
  • 197,895
  • 55
  • 485
  • 740
barej
  • 192
  • 1
  • 9
  • Inkscape 1.3.2 is not a version shipped with Ubuntu. I'm on 23.10 and even 24.04 only has 1.2.2. Please remove all third-party PPAs and reinstall Inkscape. The inkscape ./mydrawing.svg --export-area-drawing --batch-process --export-type=pdf works fine on 1.2.2 – Daniel T Feb 19 '24 at 22:24
  • @DanielT, thanks. Is there any command to remove all third party PPAs? and is there any risk involved? – barej Feb 20 '24 at 02:01
  • @DanielT, the problem is that I do not know what PPA is causing this. Here is my log: https://paste.mozilla.org/84RYkqfZ . I more suspect to snap vs apt. – barej Feb 20 '24 at 02:09
  • @DanielT, I did – barej Feb 20 '24 at 02:16
  • Oh you're using the snap. snap tends to break a lot of things related to filesystem access. sudo snap remove --purge inkscape ; sudo apt install inkscape like https://askubuntu.com/q/1414173/1004020 – Daniel T Feb 20 '24 at 02:17
  • @DanielT, the apt version is too old (Inkscape 0.92.5). It does create empty PDF file too. How can I have the 1.2.2 version? – barej Feb 20 '24 at 02:35
  • You can see which Inkscape version is available on which Ubuntu release at https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=inkscape . To avoid further bugs like the one you encountered, just upgrade the Ubuntu release to get a version of Inkscape that is tested to work together – Daniel T Feb 20 '24 at 02:38
  • For ubuntu 20.04, the version is too old (0.92.5) and for ubuntu 23.10, the version is good (1.2.2). The problem is that if I have files created with new ubuntu, I cannot convert them using the older laptop. Even the funnier part is that I followed the advise of inkscape website to install version 1.2.2 but it installs version 1.2.3 – barej Feb 20 '24 at 02:43
  • Just upgrade to 22.04. Or you could file a bug at https://bugs.launchpad.net/inkscape and wait – Daniel T Feb 20 '24 at 02:48
  • I am not even sure if downgrading to version 1.2.2 will fix the problem. But I know Inkscape-091e20e-x86_64.AppImage is working fine for me. – barej Feb 20 '24 at 02:49
  • Please post that as an answer. This might even be a limitation of snap stuff in general, so AppImage would work – Daniel T Feb 20 '24 at 02:51

1 Answers1

1

Thanks to Daniel T.

This is an issue on inkscape 1.3.1.

I submitted a bug report for now. I might not have time to follow it up.

For now, I use the Inkscape-091e20e-x86_64.AppImage (version 1.3.2) at inkscape.org and it works fine.

barej
  • 192
  • 1
  • 9