Coder Social home page Coder Social logo

Comments (6)

Doublonmousse avatar Doublonmousse commented on June 12, 2024

The first part seems to be a bug somewhere. The conversion is meant to export all shapes to bitmap images (afaik xournal++ does not support true svg import) that can be edited in xournal++ as images but they are consumed as part of the background instead.

I'm not sure yet where this comes, the difference between the rnote exported xml and a correct one where the image is not stuck in the background from xournal is not large, but I think I should be able to find the reason from that difference.

Matching xournal++ shapes should be feasible for a subset of shapes (not using the rough variant) that are simple enough (rectangles and lines seems relatively easy), I've yet to estimate if all of them are feasible though.

from rnote.

Doublonmousse avatar Doublonmousse commented on June 12, 2024

Well, I found the bug.

I had some weird things going on with the layer attribute with things like

<layer>
 <!-- image data ... -->
</layer>
<layer/>

so an odd number of delimiters. Removing the last one pushes the images out of the background.

Only opening a layer element if there is some data associated with it seems to fix the issue.

from rnote.

flxzt avatar flxzt commented on June 12, 2024

That's odd that an empty layer element <layer/> pushes the images into the background. I wonder if this is actually a bug in the file parsing in xournal++.

from rnote.

Doublonmousse avatar Doublonmousse commented on June 12, 2024

I think it's actually how xournal handles background images.

If there are multiple layers with no background, only <layer> and </layer> are used like in one of the test file (in their clear xml variant here :
https://github.com/xournalpp/xournalpp/blob/b0ce9574c17dbb31060abd9b215ed28db1e6f643/test/files/load/layer.xml#L6-L8

<layer>
<text font="Sans" size="12.00" x="171.75" y="122.25" color="black">l1</text>
</layer>

But the one that has an image background (https://github.com/xournalpp/xournalpp/blob/master/test/files/packaged_xopp/imgBackground/new.xopp) decompresses to

<?xml version="1.0" standalone="no"?>
<xournal creator="Xournal++ 1.0.9">
<title>Xournal++ document - see https://github.com/xournalpp/xournalpp</title>
<page width="800.00" height="800.00">
<background type="pixmap" domain="attach" filename="attachments/bg_1.png"/>
<layer/>
</page>
</xournal>

with the <layer/>. I'm not sure there is a comprehensive spec for the xournal file format other than reading the code and the parser.

So I think having only <layer> content </layer> is intended for each layer that is not the background and the last one <layer/> is reserved for the background ?

from rnote.

Doublonmousse avatar Doublonmousse commented on June 12, 2024

Actually, I think I'm mistaken.

@user032479798ADhiuh can you verify the layers of your xournal file ?

image

With both strokes and shapes, the shapes end up in a different layer so they are not selectable if you don't activate the correct layer. So it's probably more a usability issue with xournal (you can't select anything that is from another layer).

In that case, the "fix" I opened is still useful as it prevents empty layers from being created, and in the case of only shapes being present, there would always be an empty top layer that contains nothing and prevents shapes from being selected.

from rnote.

Doublonmousse avatar Doublonmousse commented on June 12, 2024

There's technically a mutli layer selection that doesn't work
image

See here for the xournal issue : xournalpp/xournalpp#2783

from rnote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.