Crash when trying to attach an image to key signature
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
Copy image from any image application to clipboard.
In MuseScore 3.6.2 select key signature.
Use CTRL+V to insert image.
Crash.
See also: https://musescore.org/en/node/318370
Fix version
4.0.0
Comments
Crashes are Critical, per definition
In Debug mode it dies on a failed assertion, trying to convert the image to a keysig?
Fatal: ASSERT: "e == 0 || e->isKeySig()" in file ...\libmscore\scoreElement.h, line 520
Most element types ignore an attempt to paste an image onto them. Notable exceptions include notes, rests, and measures. The pasting of an image is implemented as a "drop", and since key signatures only accept a drop if the element being dropped is another key signature, then it naturally assumes that anything dropped onto it is a key signature. But the paste function bypasses the
acceptDrop(EditData*)
function in the element's subclass, and performs the drop unconditionally, which is, of course, incorrect. The solution would be to do something like this: https://github.com/mattmcclinch/MuseScore/commit/9d27b8c.And what is the reason why it is necessary for Musescore to allow images to be attached to a key signature?
@odelphi231
No one ever said that MuseScore needs to allow this. My solution certainly does not allow images to be attached to a key signature, but rather prevents the drop from happening, considering that it is not allowed.
FWIW, though, I'd love to see more elements accept drops of images - also symbols or text. Could be a simple way to get custom displays of key or especially time signatures that go beyond what our customization facility might be designed to anticipate. Same for clefs. Not that long ago we started supporting ability to drop symbols on barlines and I've been taking advantage of that quite a bit. Hmm, really clefs, key signatures, time signatures, and I suppose breaths - that would cover pretty much all "top level" elements one might want to attach something to.
See https://github.com/musescore/MuseScore/pull/7698.
and https://github.com/musescore/MuseScore/pull/7699 (for 3.x)
Edit: bogus... but see below
In reply to @odelphi231 No one ever said… by mattmcclinch
Ok, thank you. So it is not allowed.
Fixed in branch master, commit f7fe7dbc0b
_Fix #318388: Crash when trying to attach an image to key signature
Resolves: https://musescore.org/en/node/318388._
Fixed in branch 3.x, commit f22b7bf4fb
_Fix #318388: Crash when trying to attach an image to key signature
Resolves: https://musescore.org/en/node/318388._
Automatically closed -- issue fixed for 2 weeks with no activity.
Fix for 3.x in https://github.com/musescore/MuseScore/pull/9000 (my earlier attempt in https://github.com/musescore/MuseScore/pull/7699 was bogus)