no svg file preview on Windows (rev >= 10326)

Bug #802904 reported by Alvin Penner on 2011-06-28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Patrick Storz
Patrick Storz

Bug Description

running my own compiled version of bzr 10356 on Windows XP, when I use File->Open and click on a .svg file name, then I do not see a file preview, instead just a generic Windows icon for Internet Explorer.

using the same procedure on a pre-built download of Inkscape 0.48.1, on Windows 7, the preview works normally

jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk 10342.
Not reproduced with 0.48.1 and revision 10258.

Changed in inkscape:
milestone: none → 0.49
status: New → Confirmed
tags: added: regression ui
su_v (suv-lp) wrote :

Not reproduced with Inkscape 0.48+devel on Mac OS X 10.5.8 (i386)
(tested with r10341, r10343, r10355 and r10379)

-> possibly related to recent devlibs updates for the cairo-renderer merged in r10326 (both on 2011-06-20)?

tags: added: win32
jazzynico (jazzynico) wrote :

> possibly related to recent devlibs updates

Apparently not. I can't reproduce it with the 0.48.x branch, compiled with the latest devlibs.

ScislaC (scislac) wrote :

Cairo branch merge and the win32 custom dialog not getting updated?

Alvin Penner (apenner) wrote :

to add to the weirdness, the following previews all work normally, as before : emf, wmf, gif, bmp, jpg

Alvin Penner (apenner) wrote :

It appears that the svg preview (for Windows) was disabled in bzr rev 10326, Merge Cairo rendering branch. The relevant file is src/ui/dialog/filedialogimpl-win32.cpp, routine FileOpenDialogImplWin32::set_svg_preview().

It would probably be best to mark this as "Won't Fix"

su_v (suv-lp) wrote :

> It would probably be best to mark this as "Won't Fix"

bool FileOpenDialogImplWin32::set_svg_preview()
    return false;
    // NOTE: it's not worth the effort to fix this to use Cairo.
    // Native file dialogs are unmaintainable and should be removed anyway.


Prior to that me thinks this ought to be discussed in 'inkscape-devel' whether reverting to the GTK+ dialogs in the Windows port is commonly accepted or whether Inkscape does have volunteers to keep the native dialogs updated, possibly as optional feature.

IIRC there are feature requests for both in the bug tracker by Windows users - to enhance the native dialogs, as well as to revert to the GTK+ dialogs, e.g.
Bug #417365 “please make the gtkfilechooser available again on windows”
Bug #437540 “On Vista, use Vista style file dialogs”

su_v (suv-lp) wrote :

Setting bug status to 'Medium' for now.

Changed in inkscape:
importance: Undecided → Medium
jazzynico (jazzynico) wrote :

Note that Bug #417365 “please make the gtkfilechooser available again on windows” is fixed as of revision 11109.

Changed in inkscape:
status: Confirmed → Triaged
Alvin Penner (apenner) wrote :

just writing to confirm that the file preview on Windows does indeed work correctly if you choose the Preferences option:
Interface->Windows->GTK open/save dialogs.

if you choose the native dialogs option, then the preview for svg does not work. I would propose that this be marked as "Won't Fix". I personally prefer the native dialogs, but having no preview is a very small loss compared to the comfort and reassurance of a standard native dialog, so I don't care if this gets fixed or not (and clearly the answer will be 'not').

su_v (suv-lp) on 2014-11-06
Changed in inkscape:
milestone: 0.91 → 0.92
su_v (suv-lp) wrote :

The GTK+ dialog fails (crashes) with the current 64bit MSI installer for Inkscape 0.91 on Windows 7 (crash on open, no warnings or error messages to the console). Either way, something needs to be fixed (either the preview in native dialogs, or the crash of gtk dialogs with 64bit installer).

Alvin Penner (apenner) wrote :

on Windows 7, 32 bit, Inkscape 0.91 r13725 (Jan 30 2015), if I use a GTK dialog to open a file then I get the following message, but the file opens normally.

(inkscape.exe:1576): Gtk-CRITICAL **: gtk_widget_get_visible: assertion `GTK_IS_
WIDGET (widget)' failed

the message occurs only if I use a GTK dialog and also only if I enable the preview

su_v (suv-lp) on 2015-06-15
summary: - no svg file preview on Windows, build 10356
+ no svg file preview on Windows (rev >= 10326)
su_v (suv-lp) wrote :

On 2015-03-05 22:23 (+0200), ~suv wrote:
> The GTK+ dialog fails (crashes) with the current 64bit MSI installer for
> Inkscape 0.91 on Windows 7

Tracked in
* Bug #1322889 “[win64] GTK file picker crashes on choose”

jazzynico (jazzynico) on 2017-02-23
Changed in inkscape:
milestone: 0.92 → 0.93
Patrick Storz (ede123) wrote :

Might be related to #1271938.

Patrick Storz (ede123) wrote :

No, not related.

In fact everything currently works "as designed":
- GTK dialog shows preview for raster and SVG files in Inkscape 0.92.1 r15371 (32/64 bit)
- Native dialog does not show SVG preview by design (see comment #6)

Patrick Storz (ede123) wrote :

Here's a patch to restore support for SVG previews in Windows native file open dialog.

Let me know if there are any issues...

Changed in inkscape:
assignee: nobody → Eduard Braun (eduard-braun2)
status: Triaged → In Progress
su_v (suv-lp) wrote :

I would have hoped that Inkscape at some point could switch to the native file chooser dialog as offered by GTK3 itself now:

Unfortunately, the docs currently state these limitations:

Win32 details

On windows the IFileDialog implementation (added in Windows Vista) is used. It supports many of the features that GtkFileChooserDialog does, but there are some things it does not handle:

    Extra widgets added with gtk_file_chooser_set_extra_widget().

    Use of custom previews by connecting to “update-preview”.

    Any GtkFileFilter added using a mimetype or custom filter.

If any of these features are used the regular GtkFileChooserDialog will be used in place of the native one.

which probably make this native implementation unsuited for Inkscape's current use cases of file chooser dialogs (which require custom preview and custom filters (?)).

@Eduard - did you by chance investigate this as an option? AFAICT the native file chooser dialogs are e.g. used in gtk3-demo > Pickers (for File, Folder), and also in the gtk3-widget-factory demo (file picker on the first tab).

Patrick Storz (ede123) wrote :

No, I did not look into GTK3 file choosers.
It's certainly something that could (should?) be re-avaluated for Inkscape 0.93.

su_v (suv-lp) wrote :

Patch from comment 16 tested with lp:inkscape r15556 on Windows 10:
The content of many SVG files seems to be cut off (possibly related to document scale set via SVGRoot width, height, viewBox attributes; to be investigated).

Patrick Storz (ede123) wrote :

> The content of many SVG files seems to be cut off.
Could it be files that *don't* have width/height? I tested SVG files that where scaled via viewBox successfully, so it's not the viewBox alone... In my calculations I used width/height of the SVG document, so that could be the problem.

su_v (suv-lp) wrote :

The attached file was created based on the default template in trunk, and renders less than a quarter of the page (starting with the SVG origin in the page's top-left corner) in the preview image of the native file dialog.

I initially only quickly tested the 'share\examples' files as distributed with Inkscape, similarly exposed with most of the files there (except e.g. glass.svg).

Possibly related to unit-less width, height values (equivalent to px)?

su_v (suv-lp) wrote :

su_v wrote:
> Possibly related to unit-less width, height values (equivalent
> to px)?

Nevermind, ignore that ;-)

Patrick Storz (ede123) wrote :

I think I found the issue: The preview is rendered with a maximum of 512x512 px².
I got the scaling of the preview image right, but messed up scaling of the rendering (i.e. every image is rendered unscaled up to a dimension of 512x512 px² and afterwards stretched to have the correct size in the preview area.

Unfortunately I tested only with images smaller than that yesterday and focused on viewBox stuff and the like...

Patrick Storz (ede123) wrote :

Updated patch which now should be working fine with all SVGs in /share/example and the construed testcases I threw at it.

su_v (suv-lp) wrote :

Patch v2 tested successfully on Windows 10 with lp:inkscape 15556.

Another probably off-topic question: any idea why with builds based on devlibs64 (GTK2, GTK3), as well as with your MSYS2 builds (GTK3), the file name below any preview image (i.e. also for raster graphics) is shortened to the first character? This does not happen with 32bit builds AFAICS (tested and compared with stable 7z packages of 0.91, 0.92.0 from

Patrick Storz (ede123) wrote :

SVG preview is restored in revisions
(by pushing bug802904_v2.diff)

The issue with only the first character of file names being shows is taken care of in revisions

Also a minor fix (EMF/WMF reported wrong image dimensions in the text below the preview) including some minor formatting changes was pushed in revisions

Changed in inkscape:
status: In Progress → Fix Committed

I switched Inkscape from windows native file open/save dialog to GTK dialogs, and now I get the preview window but its network (samba) support is attrocious. I have a Buffalo NAS connected to my router that I use so any files I use on nay computer are on the network drive. But requesting a network share from the "places" window isn't possible; it doesn't know about networks.

You may think the GTK file dialog is "better" but its usability is provably worse than Windows native dialog. I wonder how hard it is to get thumbnail support when trying to view documents other than when using the GTK browser.

Alvin Penner (apenner) wrote :

@Paul - comment 27 looks like a duplicate of Bug 1663845

you could try tracking that report to see if it gets resolved.

Max Gaukler (mgmax) on 2020-05-09
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions