musescore / musescore/MuseScore

Exporting SVG - differs between CLI and GUI

Open
#20,084 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Import/export issue

Bug description

When exporting to SVG, the result is sligtly different between using CLI "mscore -o output.svg input.mscz" and the Export/SVG dialog in the GUI. When opening the CLI-SVG in Inkscape and selecting all (CTRL-A) not only the printed area is selected but the whole page including blank areas. When doing the same with the GUI-generated SVG, only the musical output is selected. With the GUI-SVG file, I can simply press CTRL-SHIFT-G to "crop" (set page-size to selection) to selection. With the CLI-SVG file, I need to delete that empty background-like object, to be able to reduce the page-size.

The only difference in exported SVG files is an additional line after the <desc> in CLI-SVG file, which gets converted to object "path1" once opened and saved with Inkscape. Example:

<path class="" fill="#ffffff" fill-rule="evenodd" d="M0,0 L1672.44,0 L1672.44,4251.96 L0,4251.96 L0,0 "/>

Steps to reproduce
  1. mscore -o output-cli.svg input.mscz
  2. Export/SVG dialog in the GUI, save as output-gui.svg
  3. compare files
Screenshots/Screen recordings

No response

MuseScore Version

4.1.1-232071203, revision: github-musescore-musescore-e4d1ddf

Regression

I don't know

Operating system

Windows 10

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CLI SVG export command and the GUI Export/SVG dialog, then compare their generated SVG files as described. Reproduce with MuseScore 4.1.1 and inspect the extra page-sized path after the element. Done means both export paths produce equivalent SVG selection bounds without the unwanted blank background object.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.