create album of continuous-view scores will fail ASSERT(score()->nstaves() == staves.size()) in Measure::layout2
If I try to create album of two scores that were saved in continuous view, then this assert:
https://github.com/musescore/MuseScore/blob/master/libmscore/measure.cp…
Q_ASSERT(score()->nstaves() == staves.size());
will fail. staves.size() seems to always be twice of score()->nstaves().
Replication steps:
- File->album
- add "album_layout2-assert-staves.mscx" two times
- Join scores
Result: The ASSERT fails. (I haven't tried outside of debug mode yet)
Attachment | Size |
---|---|
album_layout2-assert-staves.mscx | 3.53 KB |
Comments
I should note that the assert failure happens not in the actual joining, but rather in the thumbnail generation code. Here is the relevant call stack when the assert failure occurs:
Isn't that why for thumbnail generation there's a temp switch back to page mode?
Here is a failing test case I've produced:
https://github.com/ericfont/MuseScore/commit/2c25391787b6a1c2060e3c57c1…
(I'm haven't really checked if this is an actual issue...assert failure occurs in thumbnail generation, which isn't a big deal...but still I'm just reporting because I think I should. If anyone has comments, let me know...)
maybe just Major...
Yes, when generate a thumbnail, it temporarily switches to page view.
So then I don't understand why album join behaves different in page mode (works) vs. continuous mode (crash). Although in SVG Export there seems to be the same problem, see #105471: SVG export crashes MuseScore in Continuous View
Came up again in https://musescore.org/en/node/269550
Not an issue in master, which handles this completely different (and joining scores in continues view leads to other problems)
I wonder whether we could fix this for 2.2
In reply to Not an issue in master,… by Jojo-Schmitz
If the solution is simple, then yes I say fix it for 2.1, and if that simple solution is basically for musescore to automatically force each individual score into page view before combining, then I say do that.
I'm away from my computer right now, so I can't investigate.
See https://github.com/musescore/MuseScore/pull/3478
It switch all scores to page view before merging and back to continues view, if the first score was in that mode
I support this PR, although I haven't tested it.
Hmm, it does not switch back to continues mode, not sure why
I now see why, fixed in updated PR
Fixed in branch 2.2, commit 20105a963a
Fix #105646: Create album of continuous-view scores crashes
Fixed in branch 2.2, commit f11cf6eb01
Merge pull request #3478 from Jojo-Schmitz/album-2.2
Fix #105646: Create album of continuous-view scores crashes
Automatically closed -- issue fixed for 2 weeks with no activity.