Add support for newer MS Visio file formats (VDX, VSDX)

Bug #1086504 reported by su_v
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
su_v

Bug Description

Follow-up report to:
Bug #1015572 “[Patch] import "Microsoft Visio Diagram (*.vsd)" files (internal, based on libvisio)”

libvisio >= 0.22 supports additional MS Visio file formats, which use a different suffix. These need to be added to Inkscape (currently, trunk only knows about *.vsd files):
<https://plus.google.com/108382325637135111255/posts/EKzVQZMpEfS>
<https://plus.google.com/108911244660285152681/posts/X4BsWSxAq5h>
<http://libregraphicsworld.org/blog/entry/libreoffice-gets-visio-2013-support>
<http://article.gmane.org/gmane.comp.graphics.inkscape.devel/39473>

Known issue:
Which types of Visio files are supported depends on runtime version of libvisio. The current extension system doesn't allow to check based on the version of a dependency, and build time configure options would not help to detect which version of libvisio is available at runtime.

Patch used for testing new formats:
Attached patch simply adds several newer file formats without further checking.
Note: with this patch, import of such newer file formats will simply fail on systems which have older versions of libvisio installed, without providing further information to the user.

TODO:
1) Verify new filetypes (possibly remove some)
2) Verify details of added file types (extension, mimetype, filetypename and -tooltip)
3) If possible, implement a runtime version check of libvisio in 'src/extension/internal/vsd-input.cpp', to only enable formats supported by the currently installed version of libvisio.
4) Discuss further desktop integration:
- add Visio filetype for Linux desktops to inkscape.desktop{.in} (?)
- add Visio filetype for Windows and OS X packages (?)

Tags: importing
Revision history for this message
su_v (suv-lp) wrote :
description: updated
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Revision history for this message
jazzynico (jazzynico) wrote :

> Which types of Visio files are supported depends on runtime version of libvisio.

Note that some recent operating systems provides relatively old libvisio versions that just can't match the minimum required to use the importer (on Debian testing, it is currently 0.0.17; Inkscape compiles correctly, but returns an error dialog when importing a Visio file).

Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

> 1) Verify new filetypes (possibly remove some)

Tested successfully on Debian testing, local libvisio-0.0.23, with VSD, VDX and VSDX files from Fridrich's test files (<http://cgit.freedesktop.org/~fridrich/libvisio-test/>).
Not tested with VST, VSS, VTX and VSDM formats.

Revision history for this message
su_v (suv-lp) wrote :

@JazzyNico: with regard to
> assignee: nobody → ~suv (suv-lp)

I don't think there's a chance I'd be able to get anywhere close to achieve this:

> 3) If possible, implement a runtime version check of libvisio in
> 'src/extension/internal/vsd-input.cpp', to only enable formats
> supported by the currently installed version of libvisio.

AFAICT based on the doxygen docs I have from libvisio 0.0.23, libvisio does not define macros for the version (libwpg, libwpd on the other hand do have macros for VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_STRING), nor does it offer a function to check the runtime version as for example cairo used to:
<http://cairographics.org/manual-1.10.2/cairo-Version-Information.html>
and likely still does (though no longer documented in the API reference manual):
<http://cgit.freedesktop.org/cairo/tree/src/cairo-version.c?id=1.12.8>

I can't tell whether there are other utility functions offered by libvisio which would be used instead, other then implementing a more verbose error dialog based on information returned from libvisio when parsing the selected file fails (e.g. because not yet supported by the installed version of libvisio).

Revision history for this message
su_v (suv-lp) wrote :

> Not tested with VST, VSS, VTX and VSDM formats.

Some VST files can be download from here:
<http://visio.microsoft.com/en-us/Samples_and_Downloads/Diagrams_and_Templates/>

I don't know whether how 'Templates' work in Visio, and what might be stored as parameterized info, nor whether it makes sense to open them in Inkscape as SVG - I simply added it for testing.

The few VSS files I found via Google all open empty for me in Inkscape, but I didn't test and compare with the output generated by the command line tools yet (vss2xhtml).

Revision history for this message
jazzynico (jazzynico) wrote :

> 3) If possible, implement a runtime version check of libvisio in
> 'src/extension/internal/vsd-input.cpp'

It can be checked and defined in configure.ac, just as it is done for wpg.
Patch attached (tested on Debian testing, local libvisio-0.0.23).

Revision history for this message
su_v (suv-lp) wrote :

Attaching a revised version of the patch which reduces the additional supported Visio file formats to vdx, vsdx and vsdm (based on feedback on irc by Fridrich).

> The few VSS files I found via Google all open empty for me in Inkscape, but I didn't
> test and compare with the output generated by the command line tools yet (vss2xhtml).

VSS (Visio stencils) work with the command line tool (vss2xhtml), but the generated SVG output wrapped in the XHTML file needs to be post-processed to be used/useful in Inkscape [1]. Maybe support for Visio stencils can be implemented later on.

[1] tested e.g. with the Microsoft Visio Stencil version of the 'AWS Simple Icons', available for download here:
   <http://aws.amazon.com/architecture/icons/>
To be usable in Inkscape, I wrapped all the <svg:svg> containers into a parent <svg> node, and - to work around known issues in Inkscape with multiple stacked <svg> nodes - I finally converted 'svg:svg.*>' globally to 'svg:g>'.

Revision history for this message
su_v (suv-lp) wrote :

JazzyNico wrote:
> It can be checked and defined in configure.ac, just as it is done for wpg.

That's not a runtime check of the installed libvisio version though… - it only checks which version was present when compiling Inkscape. Since it's a linked library, the runtime version might differ...

Revision history for this message
su_v (suv-lp) wrote :

> 11:34 su_v : what are 'vsdm' exactly (compared to vsdx)?
> 11:35 Fridrich : it is "macro enabled" but for us it is the same thing,

Revised patch v3 (dropping '(macro enabled)').

Unfortunately, I failed to figure out a way to define multiple extensions for the same file type (goal: using only one INX definition for e.g. vsdx and vsdm).

Revision history for this message
jazzynico (jazzynico) wrote :

> That's not a runtime check of the installed libvisio version though…

Yes, but since libvisio doesn't provide version information...

Revision history for this message
Fridrich (fridrich-strba) wrote :

Just require libvisio-0.0 >= 0.0.20 and you are fine, I will discuss with the debian guys for their testing

Revision history for this message
jazzynico (jazzynico) wrote :

Fridrich> Just require libvisio-0.0 >= 0.0.20 and you are fine

Do you mean in the configure.ac file, as minimum required version?

Revision history for this message
Fridrich (fridrich-strba) wrote :

Yeah, like that debian wheezy and other distros that don't have the right libvisio will have to patch inkscape and try to understand why this is the requirement. I basically know the maintainer of libvisio on debian/ubuntu, Fedora, Gentoo, and even on openSUSE (myself :))

Revision history for this message
Fridrich (fridrich-strba) wrote :

And I know they will have the right libvisio for the distro that will have inkscape 0.49

Revision history for this message
su_v (suv-lp) wrote :

JFTR - current Ubuntu (12.10 Quantal) ships with libvisio 0.0.19 (which supports VSD ok):
<http://packages.ubuntu.com/quantal/libvisio-0.0-0>

Revision history for this message
su_v (suv-lp) wrote :

On 05/12/2012 13:21, Fridrich wrote:
> Just require libvisio-0.0 >= 0.0.20 and you are fine

Attaching simplified patch: raise required min version for libvisio to 0.20, add three new file types (VDX, VSDM, VSDX) unconditionally.

Revision history for this message
jazzynico (jazzynico) wrote :

@~suv - Looks good. Feel free to commit!

Revision history for this message
su_v (suv-lp) wrote :

Committed in r11961.

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.