MusicXML import detect corrupted file when the file is minified
Reported version
3.1
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Version:
OS: macOS 10.16, Arch.: x86_64, MuseScore version (64-bit): 3.6.2.548020600, revision: 3224f34
When I import the file "beautified.musicxml", everything works fine. I get the result "beautified.png".
However when I import the file "minified.musicxml", which should be strictly equivalent, I get the warning
message File "minified.musicxml" corrupted
, with the following information:
Measure 3, staff 1 incomplete. Expected: 4/4; Found: 0/1
Measure 4, staff 1 incomplete. Expected: 4/4; Found: 0/1
Measure 5, staff 1 incomplete. Expected: 4/4; Found: 0/1
If I proceed by clicking on "ignore", I get the result "minified.png".
Attachment | Size |
---|---|
beautified.musicxml | 4.67 KB |
minified.musicxml | 3.68 KB |
minified.png | 28.85 KB |
beautified.png | 39.78 KB |
Fix version
4.0.0
Comments
With 'minified' you apparently mean the removal of all whitespace, all spaces, tabs and linefeeds.
I'm not sure whether this is allowed in MusicXML?
MuseScore 2(.3.2) cleanly imports both though.
Relates to #270643: [EPIC] MusicXML import/export issues
MuseScore 3.5(.2) fails the same way (on top it duplicates the tempo text and has both visible)
As does 3.3.4
A Debug build (latest 3.x code) dies of a failed assertion (and after having reported the duplicate tempo text):
Debug: Error at line 1 col 1748: duplicate tempo at tick 0 (...\importexport\musicxml\importmxmllogger.cpp:49, void Ms::log(Ms::MxmlLogger::Level, const QString&, const QXmlStreamReader*))
Fatal: ASSERT: "_e.isEndElement() && _e.name() == "notations"" in file ...\importexport\musicxml\importmxmlpass2.cpp, line 6191
Which indicates that it doesn't like
<notations><ornaments><mordent/></ornaments></notations>
And it indeed is the missing linefeed after the
<mordent/>
There's a rather simple possible fix, from the following code
just remove that
_e.readNext();
That code came in with 92a39fe
So got to be a 3.1 regression
See https://github.com/musescore/MuseScore/pull/7799 (for 3.x)
And https://github.com/musescore/MuseScore/pull/7809 (for master)
Fixed in branch 3.x, commit b528c8b8dc
_Fix #319210: MusicXML import corrupted when xml is stripped from whitespace
Culprit seems an (empty) `` tag if that is not followed by a newline._
Fixed in branch master, commit dfc2762227
_Fix #319210: MusicXML import corrupted when xml is stripped from whitespace
Culprit seems an (empty) `` tag if that is not followed by a newline._
Automatically closed -- issue fixed for 2 weeks with no activity.