Audiveris / audiveris

Latest generation of Audiveris OMR engine
https://audiveris.github.io/audiveris
GNU Affero General Public License v3.0
1.51k stars 225 forks source link

Error visiting PartBarline{} in {Page#1.1} java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 #674

Open phdm opened 11 months ago

phdm commented 11 months ago

Hello,

As you may remember I had a problem where systems were merged because of dark pixels at the vertical border of the page, dark pixels created by a scanning artifact. (issue #652)

Therefore I had to extract page 5, edit it with a paint program and then recreate the whole document in audiveris by importing the whole original pdf document, and the fixed page 5 (a png image), and then using the collate menu to create the audiveris document from pages 1-4 of the pdf,, png as page 5, and page 6 of the original pdf. When I try to export this recreated document, it fails with this message that seems to appear when beginning to process page 5.

Error visiting PartBarline{} in {Page#1.1} java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) at java.base/java.util.Objects.checkIndex(Objects.java:359) at java.base/java.util.ArrayList.get(ArrayList.java:427) at org.audiveris.omr.sheet.PartBarline.getEnding(PartBarline.java:138) at org.audiveris.omr.score.PartwiseBuilder.processBarline(PartwiseBuilder.java:1192) at org.audiveris.omr.score.PartwiseBuilder.processMeasure(PartwiseBuilder.java:1950) at org.audiveris.omr.score.PartwiseBuilder.processPart(PartwiseBuilder.java:2616) at org.audiveris.omr.score.PartwiseBuilder.processSystem(PartwiseBuilder.java:3094) at org.audiveris.omr.score.PartwiseBuilder.processLogicalPart(PartwiseBuilder.java:1804) at org.audiveris.omr.score.PartwiseBuilder.processStub(PartwiseBuilder.java:3045) at org.audiveris.omr.score.PartwiseBuilder.processPartList(PartwiseBuilder.java:2648) at org.audiveris.omr.score.PartwiseBuilder.processScore(PartwiseBuilder.java:2832) at org.audiveris.omr.score.PartwiseBuilder.build(PartwiseBuilder.java:3420) at org.audiveris.omr.score.ScoreExporter.export(ScoreExporter.java:122) at org.audiveris.omr.score.ScoreExporter.export(ScoreExporter.java:163) at org.audiveris.omr.sheet.Book.export(Book.java:676) at org.audiveris.omr.sheet.ui.BookActions$ExportBookTask.doInBackground(BookActions.java:2173) at org.audiveris.omr.sheet.ui.BookActions$ExportBookTask.doInBackground(BookActions.java:2146) at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)

Which file should I send you to help you to debug ?

PS: I have not tested yet your fix for the wrongly merged systems, but it seems to me that the above is still worth reporting, even if my original problem is perhaps fixed with your patch

hbitteur commented 11 months ago

@phdm I don't think I need any special input. I will simply do the same actions you made on a multi-sheet book. A similar problem should occur.

But please be patient, I'm chasing several hares at the same time... :-)