Pull request #148: RED-1378: fix: merging images condition

Merge in RED/redaction-service from mergingFix to master

* commit '047ac9bf848d168b2a1bbe9217538b6bdac00de6':
  RED-1378: fix: merging images condition
This commit is contained in:
Clarissa Dietrich 2021-04-26 12:16:10 +02:00
commit e723208473

View File

@ -175,8 +175,12 @@ public class PdfSegmentationService {
} else {
// if the last candidate is false, then both images i and i+1 must be added
if (i == candidatesList.size()-1){
mergedList.add(imageList.get(i));
mergedList.add(imageList.get(i+1));
if (countElementsInList> 0 && mergedList.get(countElementsInList-1) == imageList.get(i)){
mergedList.add(imageList.get(i+1));
}else {
mergedList.add(imageList.get(i));
mergedList.add(imageList.get(i + 1));
}
}else {
//first image is not splitted, add i to resultlist
if (beginImage){