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

Bug #802904 reported by Alvin Penner
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Patrick Storz
0.92.x
Fix Released
Medium
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

Revision history for this message
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
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
ScislaC (scislac) wrote :

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

Revision history for this message
Alvin Penner (apenner) wrote :

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

Revision history for this message
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"

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

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

<quote>
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.

</quote>
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/ui/dialog/filedialogimpl-win32.cpp#L954>

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”

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

Setting bug status to 'Medium' for now.

Changed in inkscape:
importance: Undecided → Medium
Revision history for this message
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
Revision history for this message
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)
Changed in inkscape:
milestone: 0.91 → 0.92
Revision history for this message
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).

Revision history for this message
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)
summary: - no svg file preview on Windows, build 10356
+ no svg file preview on Windows (rev >= 10326)
Revision history for this message
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”
  https://bugs.launchpad.net/inkscape/+bug/1322889

jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.92 → 0.93
Revision history for this message
Patrick Storz (ede123) wrote :

Might be related to #1271938.

Revision history for this message
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)

Revision history for this message
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
Revision history for this message
su_v (suv-lp) wrote :

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

https://blogs.gnome.org/alexl/2015/11/05/native-file-choosers-in-gtk/
https://developer.gnome.org/gtk3/stable/gtk3-GtkFileChooserNative.html

Unfortunately, the docs currently state these limitations:

<quote>
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.
</quote>

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).
</off-topic>

Revision history for this message
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.

Revision history for this message
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).

Revision history for this message
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.

Revision history for this message
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)?

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

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

Nevermind, ignore that ;-)

Revision history for this message
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...

Revision history for this message
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.

Revision history for this message
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 inkscape.org).

Revision history for this message
Patrick Storz (ede123) wrote :

SVG preview is restored in revisions
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15558
http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15398
(by pushing bug802904_v2.diff)

The issue with only the first character of file names being shows is taken care of in revisions
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15559
http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15399

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
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15560
http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15400

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
Paul Robinson (paul-paul-robinson) wrote :

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.

Revision history for this message
Alvin Penner (apenner) wrote :

@Paul - comment 27 looks like a duplicate of Bug 1663845
https://bugs.launchpad.net/inkscape/+bug/1663845

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

Max Gaukler (mgmax)
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

Related questions

Remote bug watches

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