Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting in annotation formats is not preserved #46

Open
Bidski opened this issue Mar 13, 2018 · 5 comments
Labels
bug
Milestone

Comments

@Bidski
Copy link

@Bidski Bidski commented Mar 13, 2018

When exporting annotations the indentation of each line is not preserved. This breaks formats that rely on indentation to work (like YAML).

For example, a format like this:

# Base format
imageset_%%imageset:
    description: %%setdecsription
    team: %%team
    location: %%setlocation
    %%content

# Image format
    %%imagename:
        dimensions: [%%imagewidth, %%imageheight]
        num_annotations: %%annoamount
        %%annotations

Produces an output like this:

imageset_bitbots-nagoya-01:
    description: %%setdecsription
    team: Bit-Bots
    location: nagoya
    
ball_move_1_00001.png:
        dimensions: [800, 600]
        num_annotations: 5

Here, the issue is that ball_move_1_00001.png: should be indented to line up with location. The same issue occurs with the annotation formats too.

It also appears as though an extra newline is appended to the base format. While this shouldn't break YAML syntax, it is an unexpected occurrence.

@NFiedler

This comment has been minimized.

Copy link
Member

@NFiedler NFiedler commented Mar 14, 2018

We actually had the same problem before, but we fixed it by adding the indentation to the image and annotation formats manually in the admin console. Now i tried to create the right indentation in the regular form offered to the user, but the indentation somehow gets lost in the process. While this shouldn't happen i'd additionally propose %%indentedcontent as a content placeholder which preserves the indentation of the placeholder.

The added newline is a weird quirk, I'll look into it.

@NFiedler NFiedler added the bug label Mar 14, 2018
@NFiedler

This comment has been minimized.

Copy link
Member

@NFiedler NFiedler commented Mar 14, 2018

@NFiedler

This comment has been minimized.

Copy link
Member

@NFiedler NFiedler commented Mar 14, 2018

Now the white-spaces at the beginning of the text area are kept. To indent the annotations for example, the indentation has to be made in the annotation fornat for every single line. But the %%annotation placeholder shouldn't be indented in the image format.
This is not the perfect solution for this issue, just a way around...

@Daniel451 Daniel451 added this to the v0.6 milestone Jun 20, 2018
@johagge

This comment has been minimized.

Copy link
Member

@johagge johagge commented Nov 12, 2018

Currently white-spaces are still stripped in the Vector format.

@timonegk

This comment has been minimized.

Copy link
Member

@timonegk timonegk commented Nov 14, 2018

@johagge I fixed that in f3d9bcb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.