From 7218098305f617151303e4c8a8adcf6077c1a684 Mon Sep 17 00:00:00 2001 From: Roan Date: Sat, 1 Dec 2018 01:45:54 +0100 Subject: [PATCH] Fix some @2x animation frames being listed as foreign --- .../src/me/roan/osuskinchecker/ImageInfo.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/osuSkinChecker/src/me/roan/osuskinchecker/ImageInfo.java b/osuSkinChecker/src/me/roan/osuskinchecker/ImageInfo.java index 15fa2f4..ef83cb5 100644 --- a/osuSkinChecker/src/me/roan/osuskinchecker/ImageInfo.java +++ b/osuSkinChecker/src/me/roan/osuskinchecker/ImageInfo.java @@ -343,14 +343,21 @@ private File checkForFile(File folder, String name, boolean hd, final String ext animated = true; SkinChecker.allFiles.remove(match); int c = 1; - File f = null; + File fhd; File fsd; - while((fsd = new File(folder, name + "-" + c + "." + ext)).exists() || (f = new File(folder, name + "-" + c + "@2x." + ext)).exists()){ + while(true){ + fsd = new File(folder, name + "-" + c + "." + ext); + fhd = new File(folder, name + "-" + c + "@2x." + ext); + + if(!fsd.exists() && !fhd.exists()){ + break; + } + if(!hd){ empty = empty ? isEmptyImage(fsd) : false; } SkinChecker.allFiles.remove(fsd); - SkinChecker.allFiles.remove(f); + SkinChecker.allFiles.remove(fhd); c++; } frames = c; @@ -362,14 +369,21 @@ private File checkForFile(File folder, String name, boolean hd, final String ext animated = true; SkinChecker.allFiles.remove(match); int c = 1; - File f = null; + File fhd; File fsd; - while((fsd = new File(folder, name + c + "." + ext)).exists() || (f = new File(folder, name + c + "@2x." + ext)).exists()){ + while(true){ + fsd = new File(folder, name + c + "." + ext); + fhd = new File(folder, name + c + "@2x." + ext); + + if(!fsd.exists() && !fhd.exists()){ + break; + } + if(!hd){ empty = empty ? isEmptyImage(fsd) : false; } SkinChecker.allFiles.remove(fsd); - SkinChecker.allFiles.remove(f); + SkinChecker.allFiles.remove(fhd); c++; } frames = c;