Comment 6 for bug 1089040

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

strictly speaking, this last comment 5, is a separate issue, not related to the original report. The original report concerned the question of whether the export settings were being correctly remembered or not. The answer to that is yes, they are remembered. For example, use the following steps:
- open sample_dpibugfile.svg
- set the png export dpi at 37.89 just for fun
- export the png file and make sure to save the svg file as well, this is very important
- now read the svg file in a text editor and get the settings:

   inkscape:export-xdpi="37.889999"
   inkscape:export-ydpi="37.889999

- note that there is a bit of round-off error but that is not serious
- now read the preferences.xml file and get the settings:

      <group
         id="exportarea"
         value="page" />
      <group
         id="defaultxdpi"
         value="37.89" />

- in this case there is no round-off error here
- now reload Inkscape and note that it remembers the 37.89 dpi value

- the exact behavior you get on the reload may depend on whether you saved the svg file or not, because the data is stored in two places. If you did not save the svg file then the value remembered in the preferences may be different than the value stored in the file. The next time you start Inkscape, if you start it with no file specified, then you will initially get the value stored in the preferences, and then if you load the svg file you will get the value stored in the file.

with respect to comment 5, the problem here is that there are two ways of doing the calculation. you can either do it by using dpi to calculate the png image size or you can do it by using png image size to calculate dpi. The two methods will normally not agree due to round-off error, since the image size is apparently rounded-off to be an integer, while the dpi is not rounded. The exact result you get may depend on which text box you last clicked on or which text box most recently lost focus. If you want the dpi to be fixed at 36 then I think the best thing to do is just make sure that the dpi box is the last thing you touch before you export.

 unfortunately the situation is a bit unnecessarily complicated. one way to simplify it would be to make the dpi as the independent variable and make the image size to be a dependent variable which could not be directly edited. However that would almost certainly disagree with some other users's preferences.