mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] Double read textures
This commit is contained in:
parent
5aa4fe8d47
commit
5436b2a2d6
1 changed files with 6 additions and 2 deletions
|
@ -37,16 +37,20 @@ public Texture(String url, boolean cloak, Map<String, String> metadata) throws I
|
|||
}
|
||||
|
||||
// Get digest of texture
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, new URL(url));
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata; // May be auto-detect?
|
||||
}
|
||||
|
||||
public Texture(String url, Path local, boolean cloak, Map<String, String> metadata) throws IOException {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
byte[] texture;
|
||||
try (InputStream input = IOHelper.newInput(local)) {
|
||||
texture = IOHelper.read(input);
|
||||
}
|
||||
try (ByteArrayInputStream input = new ByteArrayInputStream(texture)) {
|
||||
IOHelper.readTexture(input, cloak); // Verify texture
|
||||
}
|
||||
this.digest = SecurityHelper.digest(DIGEST_ALGO, local);
|
||||
this.digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue