Skip to content

Commit

Permalink
continue image decoding if iio returned null
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Jan 11, 2024
1 parent 7123915 commit f1ff761
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ protected BufferedImage decodeImage(List<? extends Beacon> beacons) {
@SuppressWarnings("unchecked")
GeoscanPictureDecoder decoder = new GeoscanPictureDecoder((List<GeoscanBeacon>) beacons);
while (decoder.hasNext()) {
return decoder.next();
BufferedImage result = decoder.next();
if (result == null) {
continue;
}
return result;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ protected BufferedImage decodeImage(List<? extends Beacon> beacons) {
@SuppressWarnings("unchecked")
SputnixPictureDecoder decoder = new SputnixPictureDecoder((List<SputnixBeacon>) beacons);
while (decoder.hasNext()) {
return decoder.next();
BufferedImage result = decoder.next();
if (result == null) {
continue;
}
return result;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ public class StratosatTk1Decoder extends TelemetryDecoder {
public StratosatTk1Decoder(PredictOreKit predict, Configuration config) {
super(predict, config);
}

@Override
protected BufferedImage decodeImage(List<? extends Beacon> beacons) {
@SuppressWarnings("unchecked")
StratosatTk1PictureDecoder decoder = new StratosatTk1PictureDecoder((List<StratosatTk1Beacon>) beacons);
while (decoder.hasNext()) {
return decoder.next();
BufferedImage result = decoder.next();
if (result == null) {
continue;
}
return result;
}
return null;
}
Expand Down

0 comments on commit f1ff761

Please sign in to comment.