Use 96dpi when displaying SVGs
Hi,
other programs (Firefox, Inkscape) use 96dpi when converting units of SVG files to pixels while rsvg, which EOG relies on, uses 90dpi. This results in SVG to have different dimensions in EOG compared to said programs, when original units are not in pixels
See the attached example file, it's 200px on each dimension in Inkscape and Firefox, and 188px in EOG.
The 96dpi value is what the CSS standard specifies (https://www.w3.org/TR/css3-values/#absolute-lengths) and what should be assumed for SVG too (the discussion about units in Inkscape can be found here: http://wiki.inkscape.org/wiki/index.php/Units_In_Inkscape).
Unfortunately changing rsvg does not seem possible (see librsvg#353 (comment 336712) and librsvg#367 (closed)), but I think the issue can at least be fixed in EOG.
The change looks quite easy:
diff --git a/src/eog-image.c b/src/eog-image.c
index b9688630..7fb552a9 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -985,6 +985,7 @@ eog_image_real_load (EogImage *img,
file_path = g_file_get_path (priv->file);
rsvg_handle_set_base_uri (priv->svg, file_path);
g_free (file_path);
+ rsvg_handle_set_dpi_x_y (priv->svg, 96.0, 96.0);
}
#endif
I can send a proper merge request if this looks OK.
Thank you, Antonio