Sozi icon indicating copy to clipboard operation
Sozi copied to clipboard

Problem reopen sozi file in 17.06

Open flagadajones opened this issue 9 years ago • 11 comments

Hi,

I have a problem with Sozi 17.06. When I save a sozi presentation and reopen it .
all frames are saved but Frames Zoom and position are lost.

Steps to reproduce :

  • create a Svg with many layers
  • open Sozi 17.06 with this Svg
  • add all layers in Sozi
  • create new Frame
  • zoom in specific position
  • create new frame
  • move layer to another position.

save file close Sozi reopen sozi with same svg

==> 1rst frame is ok ==> 2nd is not good, position and zoom are KO.

flagadajones avatar Nov 14 '17 16:11 flagadajones

I join 2 Sozi files prez.sozi-after-close Sozi.json : 1rst sozi file save after when i quit Sozi. prez.sozi-after-reopen Sozi.json : 2nd sozi file auto saved after i reload my project without modification.

there are many diffs between files . Many cx/cy ,height/width, widthFactor/HeightFactor and deltaX/deltaY attributes are wrong in the 2nd file ex: 1rst file :

       "layer19": {
          "cx": 105.26034710322676,
          "cy": 148.29850828895417,
          "width": 54.78229094312746,
          "height": 41.116951259742464,
          "opacity": 0,
          "angle": 0,
          "clipped": false,
          "clipXOffset": 0,
          "clipYOffset": 0,
          "clipWidthFactor": 1,
          "clipHeightFactor": 1
        },
...
"layer19": {
          "deltaX": 5.1353471032267635,
          "deltaY": 1.9860082889541673,
          "widthFactor": 15.24376791460938,
          "heightFactor": 12.530880383921515,
          "deltaAngle": 0
        },

2nd file

"layer19": {
          "cx": 5.1353471032267635,
          "cy": 1.9860082889541673,
          "width": 1,
          "height": 1,
          "opacity": 0,
          "angle": 0,
          "clipped": false,
          "clipXOffset": 0,
          "clipYOffset": 0,
          "clipWidthFactor": 1,
          "clipHeightFactor": 1
        },
...
"layer19": {
          "deltaX": -94.95840289677324,
          "deltaY": -144.33430421104583,
          "widthFactor": 0.2831858407079646,
          "heightFactor": 0.3033175355450237,
          "deltaAngle": 0
        },

Issue-403.zip

flagadajones avatar Nov 14 '17 16:11 flagadajones

Can you send me the SVG file? I cannot reproduce the issue without it.

aumouvantsillage avatar Nov 19 '17 09:11 aumouvantsillage

my zip with screenshots + SVG + sozi.json files Sozi.zip

flagadajones avatar Nov 24 '17 09:11 flagadajones

This issue seems to be related to issue #398 and to this discussion In many places in your presentation, Sozi uses text elements as "anchors" for positioning the layers.

It seems that Chrome (which Sozi is based on) cannot reliably compute the geometry of text elements. I will try to confirm that. Until this is solved, I can suggest two possible workarounds:

aumouvantsillage avatar Nov 25 '17 21:11 aumouvantsillage

I confirm that the bug happens only when a text element is used as a "reference element" by Sozi. The rendering engine returns different coordinates for the same text element:

  1. When clicking the button "set as outline element" with the Id of a text element.
  2. When saving the presentation
  3. When reopening the presentation.

I also confirm that Sozi behaves normally when texts are converted to paths.

aumouvantsillage avatar Nov 26 '17 21:11 aumouvantsillage

I'm experiencing the same issue... I save my file and when I reopen it the layer positions is lost. I'm running version 19. Is there any fix for this? It's very annoying when making big presentations (I have to reorganize everything because of that).

viniciusov avatar Jul 01 '19 03:07 viniciusov

I cannot really "fix" this issue since it is not in my own code. Currently, the only reliable workaround is to convert all texts to paths in your SVG.

In my workflow, I usually keep two versions of each original SVG:

  • some-presentation.src.svg is the original document where I can modify the text
  • some-presentation.svg is a copy of the original, where all texts have been converted to paths. This document is used for creating the Sozi presentation.

aumouvantsillage avatar Jul 01 '19 08:07 aumouvantsillage

Thanks for this workaround idea senshu. I'll try to use this way.

When you change some text, you change some-presentation.src.svg, convert text to path and save as some-presentation.src.svg... and doing that way your text don't move after resaving and reopening it in Sozi?

One of the problem I had is that sozi autosaves as soon as I reopen the file. So if the text position changes, I lost the original file. Is it possible to disable this autosave?

viniciusov avatar Jul 01 '19 11:07 viniciusov

When you change some text, you change some-presentation.src.svg, convert text to path and save as some-presentation.src.svg

The actual steps are:

  1. Create some-presentation.src.svg
  2. Convert all texts to paths and save to some-presentation.svg
  3. Open some-presentation.svg in Sozi

To modify the document, the steps are:

  1. Modify some-presentation.src.svg
  2. Convert all texts to paths and save to some-presentation.svg
  3. Continue working on the presentation in Sozi based on some-presentation.svg

Converting texts to paths every time you modify your source SVG can be tedious and there is a risk to overwrite your original document by mistake. For this reason, I run the "convert-and-save" action using Inkscape from the command line like this:

inkscape --export-plain-svg=some-presentation.svg --export-text-to-path some-presentation.src.svg

The only file that I actually open in the Inkscape GUI is some-presentation.src.svg.

Is it possible to disable this autosave?

There is a preference for that but it seems to be broken.

aumouvantsillage avatar Jul 01 '19 13:07 aumouvantsillage

For this reason, I run the "convert-and-save" action using Inkscape from the command line like this:

inkscape --export-plain-svg=some-presentation.svg --export-text-to-path some-presentation.src.svg

Many thanks! I'll try this way.

There is a preference for that but it seems to be broken.

Should be good to have this option working properly, to avoid losing the original files (if not running with this "convert-and-save" action). But thanks for the workaround.

viniciusov avatar Jul 01 '19 14:07 viniciusov

I'm closing this issue as a duplicate of #398

aumouvantsillage avatar Nov 21 '19 21:11 aumouvantsillage