After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 108435 - SVG scaling support
SVG scaling support
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
git master
Other All
: Normal enhancement
: GNOME3.0
Assigned To: EOG Maintainers
EOG Maintainers
: 335576 348175 364219 395280 532730 (view as bug list)
Depends on:
Blocks: 518055 615344
 
 
Reported: 2003-03-15 09:01 UTC by Mark Finlay
Modified: 2010-04-18 12:38 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Re-render scalable images when zooming (10.00 KB, patch)
2006-05-31 22:07 UTC, Pat Rondon
none Details | Review
Simpler version of the previous patch (9.20 KB, patch)
2006-05-31 23:22 UTC, Pat Rondon
none Details | Review
Attempt to render SVG with librsvg/cairo. (13.88 KB, patch)
2010-03-21 02:20 UTC, Hiroyuki Ikezoe
none Details | Review

Description Mark Finlay 2003-03-15 09:01:03 UTC
It'd be really great to be able to preview svg images with the eog.
Right now you can see them as icons in nautilus but there is
no way to actually view them in a program.
Comment 1 Christian Fredrik Kalager Schaller 2003-06-13 17:11:58 UTC
EOG can now view SVG files, but they are not scaled properly
Comment 2 Simon Porter 2004-02-23 16:43:53 UTC
Notes: Changed to GNOMEVER2.7. Added bugsquad keyword
Comment 3 Joshua Clayton 2004-12-05 05:09:44 UTC
Since SVG files are (in theory) infinitely scalable, to properly zoom in and
out, EOG needs to recalculate the raster from the original SVG every time it is
zoomed in or out or fullscreen.

I would like to use EOG and a text editor to do SVG work. Not Possible unless
real scaling is allowed.
Comment 4 Alex Duggan 2005-09-15 17:22:40 UTC
moving to gnome 2.13
Comment 5 Sergej Kotliar 2006-03-22 22:11:26 UTC
*** Bug 335576 has been marked as a duplicate of this bug. ***
Comment 6 Pat Rondon 2006-05-31 22:07:23 UTC
Created attachment 66559 [details] [review]
Re-render scalable images when zooming

This patch will re-render scalable images when zooming.  If the pixbuf loader says the image is scalable, the image data is saved inside the EogImage.  When the user zooms in, if the image is scalable it will be re-rendered from the source data.  This zoomed pixmap is saved in EogScrollView along with the original-size pixmap.
Comment 7 Pat Rondon 2006-05-31 23:22:40 UTC
Created attachment 66562 [details] [review]
Simpler version of the previous patch

A much simpler version of the patch which has the added benefit of working correctly with full-screen mode. =P
Comment 8 Felix Riemann 2006-06-08 13:34:50 UTC
Maybe I'm mistaken, but I think these patches bear the possibility to use quite a lot of memory especially when zooming in. The problem is that the re-rendering increases the in-memory pixel data used by the respective GdkPixbuf. An image at 2048x1536 uses about 12MB memory (using an RGBA32 visual because of transparency). When I zoom this in to 2000% it uses 240MB memory only for its pixel data.

I think a better approach would be to take advantage of the fact that the image displaying component is a GtkDrawingArea which can be drawn to using cairo/librsvg. I'm not sure how this would behave in terms of memory usage.
Comment 9 Pat Rondon 2006-06-08 18:02:39 UTC
I didn't consider the memory implications - you're right, Felix.  Unfortunately, there doesn't seem to be any way to load a portion of an image without going around GDK and using librsvg directly.  (Actually, a quick glance at the API docs makes me think librsvg doesn't support what we need, either.)
Comment 10 Sergej Kotliar 2006-07-21 00:33:30 UTC
*** Bug 348175 has been marked as a duplicate of this bug. ***
Comment 11 Verdoïa Laurent 2006-10-22 16:30:58 UTC
*** Bug 364219 has been marked as a duplicate of this bug. ***
Comment 12 Claudio Saavedra 2007-01-11 05:09:50 UTC
*** Bug 395280 has been marked as a duplicate of this bug. ***
Comment 13 Claudio Saavedra 2008-05-12 13:46:17 UTC
*** Bug 532730 has been marked as a duplicate of this bug. ***
Comment 14 Andreas Moog 2008-09-06 23:17:02 UTC
Is there any news on this issue? This has been nearly 2 years without further notice, so i just wanted to check if there are still plans to change the behaviour of eog. Thanks.
Comment 15 Phil 2010-02-26 05:14:03 UTC
Years Later, eog still renders SVG files blurry on rescale.
This is a vector graphics format so this is unnecessary.

Can anyone recommend another viewer for svg files?
Comment 16 Alex Valavanis 2010-02-28 09:17:00 UTC
Inkview is very minimal, but renders SVGs very well.  It's part of Inkscape.
Comment 17 Hiroyuki Ikezoe 2010-03-21 02:20:28 UTC
Created attachment 156658 [details] [review]
Attempt to render SVG with librsvg/cairo.

Apparently slower then before.
Comment 18 Felix Riemann 2010-03-21 19:06:21 UTC
Nice. Seems to work well so far. Haven't looked at the code yet, though.

You might get a little bit faster by drawing the anti-aliased version directly, skipping the unfiltered version.

Still librsvg doesn't seem to be the fastest, gradients seem to really slow it down.
Comment 19 Hiroyuki Ikezoe 2010-03-23 11:02:46 UTC
(In reply to comment #18)

> You might get a little bit faster by drawing the anti-aliased version directly,
> skipping the unfiltered version.

Yes, I tried it at first but it was negligible. The cost of svg rendering is very expensive.

> Still librsvg doesn't seem to be the fastest, gradients seem to really slow it
> down.

I don't investigate about gradients yet, but found an issue for rendering. I filed a bug with a patch. The patch makes EOG significant faster. Please see bug #613672.
Comment 20 Felix Riemann 2010-03-28 18:03:09 UTC
(In reply to comment #19)
> (In reply to comment #18)
> 
> > You might get a little bit faster by drawing the anti-aliased version directly,
> > skipping the unfiltered version.
> 
> Yes, I tried it at first but it was negligible. The cost of svg rendering is
> very expensive.

Hmm, I guess you're right. The experience feels better to me with showing the unfiltered version first as you see the UI react much quicker.

> 
> > Still librsvg doesn't seem to be the fastest, gradients seem to really slow it
> > down.
> 
> I don't investigate about gradients yet, but found an issue for rendering. I
> filed a bug with a patch. The patch makes EOG significant faster. Please see
> bug #613672.

Yes, helps a lot.


I am going to review the patch for one of the first GNOME 2.32/3.0 development releases.
Comment 21 Felix Riemann 2010-04-18 12:38:42 UTC
There we go. Thanks for the patch.

commit 21caf5f03041e236157e967bf2c07832b5ba551b
Author: Hiroyuki Ikezoe <>
Date:   Sun Apr 18 14:12:17 2010 +0200

    Render SVGs using librsvg when filtering is enabled
    
    Redraws scaled SVGs correctly instead of just showing a scaled and
    filtered pixbuf. Note that depending on the filters used by the image
    rendering can be quite slow at large zoom factors. Fixes bug 108435.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.