Get rid of thumb magic (closes #237)

This commit is contained in:
Jonas Herzig
2020-11-05 16:31:10 +01:00
parent 4402650971
commit 3ce10d4855
2 changed files with 2 additions and 7 deletions

View File

@@ -390,13 +390,8 @@ public class GuiReplayViewer extends GuiScreen {
for (final File file : files) {
if (Thread.interrupted()) break;
try (ReplayFile replayFile = new ZipReplayFile(new ReplayStudio(), file)) {
// TODO add a getThumbBytes method to ReplayStudio
final Image thumb = Optional.ofNullable(replayFile.get("thumb").orNull()).flatMap(stream -> {
final Image thumb = Optional.ofNullable(replayFile.getThumbBytes().orNull()).flatMap(stream -> {
try (InputStream in = stream) {
int i = 7;
while (i > 0) {
i -= in.skip(i);
}
return Optional.of(Image.read(in));
} catch (IOException e) {
e.printStackTrace();